Jump to content

[SOLVED] Preventing from double login (same user - different computers)


Recommended Posts

You can keep the logged in status saved in a column in the db and in your login script, not only check user/pw, check login status.  If it's currently set as logged in, give message saying you can't login.  Set status to logged off if user logs out.  If user doesn't log out (just closes the browser or whatever), you can also have a column that shows timestamp of last request from user.  Setup a cron job to set status as logged off after x amount of time. 

 

Some people have those columns as part of the user account table.  Some people use a separate table to hold currently active sessions.  If you have a large user base, I'd go for the 2nd option.

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.