zgkhoo Posted October 7, 2007 Share Posted October 7, 2007 how to prevent multiple login for single user account? eg user A login AccountA in german while user B also login AccountA in netherland(at the same time) that website.. how to prevent this? set login status in mysql or? thanks.. Quote Link to comment https://forums.phpfreaks.com/topic/72165-how-to-prevent-multiple-login-for-single-user-account/ Share on other sites More sharing options...
d.shankar Posted October 7, 2007 Share Posted October 7, 2007 You have to set it in MySQL. If user has logged in US , update the status as Online in mysql db Now at the same time if another user with the same account (Consider the account's been hacked) logs in UK , you have to compare with the status in the MySQL , if its online Log Him Out. Quote Link to comment https://forums.phpfreaks.com/topic/72165-how-to-prevent-multiple-login-for-single-user-account/#findComment-363883 Share on other sites More sharing options...
ludjer Posted October 7, 2007 Share Posted October 7, 2007 try store the first guys IP and time in IP_address and time_last_active columns in the mysql database and create a script that will not allow anyone other then that IP to use that username to browse the site during the 5 min activity time Quote Link to comment https://forums.phpfreaks.com/topic/72165-how-to-prevent-multiple-login-for-single-user-account/#findComment-363885 Share on other sites More sharing options...
heckenschutze Posted October 7, 2007 Share Posted October 7, 2007 Don't do that, what if the user used a proxy server? Or several proxy servers? Some ISPs even use proxy servers, so your user would be pretty pissed off if you told them their account had been 'hacked' when they try to log in. Just chuck an extra field in your user table, 'lastAction' or something. Which stores a timestamp of their last action, if someone else tries to login in a time say greater than 'lastAction' + timeout then let them (and destroy the original session), else don't. Quote Link to comment https://forums.phpfreaks.com/topic/72165-how-to-prevent-multiple-login-for-single-user-account/#findComment-363898 Share on other sites More sharing options...
zgkhoo Posted October 7, 2007 Author Share Posted October 7, 2007 then how to let the website know whether the user is online or offline? Quote Link to comment https://forums.phpfreaks.com/topic/72165-how-to-prevent-multiple-login-for-single-user-account/#findComment-363950 Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.