Anisuzzaman Posted February 18, 2007 Share Posted February 18, 2007 How to block parallel login? ----------------------------------- How can I block multiple login attempts in to a single account, when that user have already logged in? Like... Yahoo/Hotmail email accounts... 1. When I logged in, using <username: russell> & <password: 123> from <my pc: xunit> 2. Until I logout or close my browser, the system should not allow me to login again from <my pc: xunit> or from any other pc, using same <username> and <password>. How can I solve my problem? Please help… Link to comment https://forums.phpfreaks.com/topic/39006-how-to-block-parallel-login/ Share on other sites More sharing options...
sspoke Posted February 18, 2007 Share Posted February 18, 2007 ok u just need to make a flag when you login loggedinflag set to 1 if someone trys to login it would check in sql.. if user/password match and loggedinflag <> 1 when you logout it would set flag to 0 or something close browser part is hard to do but you can set a timeout record a timestamp of last login in sql too Link to comment https://forums.phpfreaks.com/topic/39006-how-to-block-parallel-login/#findComment-187807 Share on other sites More sharing options...
JasonLewis Posted February 18, 2007 Share Posted February 18, 2007 using ajax might work with the browser closing. Link to comment https://forums.phpfreaks.com/topic/39006-how-to-block-parallel-login/#findComment-187825 Share on other sites More sharing options...
corbin Posted February 18, 2007 Share Posted February 18, 2007 You could log the session ID of the logged in person, and when someone else logs in update the session ID so it logs the other person out... Just an idea... Link to comment https://forums.phpfreaks.com/topic/39006-how-to-block-parallel-login/#findComment-187826 Share on other sites More sharing options...
superuser2 Posted February 18, 2007 Share Posted February 18, 2007 I would suggest corbin's. However, I would not suggest using flags because people don't always have javascript and people don't always log out. I would suggest logging a 'last activity' time and if the user has had activity in the last 5 minutes don't let them login. When they logout clear out the last activity time. Link to comment https://forums.phpfreaks.com/topic/39006-how-to-block-parallel-login/#findComment-187928 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.