Jump to content

Recommended Posts

Hello!

I need an idea of how to make a user login from only one computer. If he tries to login from a second computer while he is logged into his account from the first computer, the user will be automatically logged out from the first computer and logged in on the second one. It is similar to the Yahoo Mail and Yahoo Messenger and would really appreciate an idea of how to make this the best way.

 

Thank you

Link to comment
https://forums.phpfreaks.com/topic/68708-unique-user-authentification/
Share on other sites

basic idea would be have a table "sessions" when the user logs in, the login script looks for an entry in the sessions table and removes them(it), then it creates one, with the session_id being used.. now everytime you check the user is logged in you can check tha the current users session id is the same as the one in the database.. if not then clear then session_destory().

 

please note thats just a draft

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.