Jump to content

how to prevent multiple login for single user account?


Recommended Posts

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.

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

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.

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.