Welcome Guest, Not a member yet? Register   Sign In
Terminate previous user login for multiple concurrent user login
#1

[eluser]Unknown[/eluser]
How to terminate user session and navigate to login page if there is open in more than one browser with same user name and password.
I can get this my using codeigniter ci_usersession table. I can store current user login details with session id, If the same user data exist will ask the user to enter the security code to terminate previous session, and if the security code is correct current session details will be store in database table and previous session will be delete.

For this, will check the ajax call for the server whether current session is available in table. My ajax calling the server for every 10 second. So this database load getting increasing. How to avoid database load and terminate previous user session if the new user login with same login details.
#2

[eluser]Krystian[/eluser]
Hmmm what do you think about handling it via trigger?
When you logged run a trigger for insert update ci_session table. If already exists a row with the same user and there is user data run delete this row r updae clearing user data column
#3

[eluser]Unknown[/eluser]
Deleting in table in not an issue i can delete the previous if the user details is identical. But i have to navigate previous session user web page to login page. If the user continuously navigate the page means i can check the session and navigate to login page. But there having single transaction page(Live market Rate Display Page). There user will monitor rates, there i have to check like push notification.
#4

[eluser]sv3tli0[/eluser]
You can add field inside the user table called: Session_id Smile
And on each login to update it with the current user sessionId..

After that you have only to check if session id match for current user Smile

This will allow users to access from only 1 device at the same time.
There can be problem if user have PC,tablet, smartphone,notebook and he want to access your site all the time..
In this case you can create 1 table user_sessions where to store user_id and session id and to allow for example max 5 log-ins at the same time.. (removing oldest when user use more devices then your limit)




Theme © iAndrew 2016 - Forum software by © MyBB