Jump to content

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


liad

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.

Archived

This topic is now archived and is closed to further replies.

×
×
  • 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.