Handling multiple login session from the same user

PHP programming forum. Ask questions or help people concerning PHP code. Don't understand a function? Need help implementing a class? Don't understand a class? Here is where to ask. Remember to do your homework!

Moderator: General Moderators

Post Reply
francisjeffy
Forum Newbie
Posts: 17
Joined: Fri Feb 29, 2008 12:10 pm

Handling multiple login session from the same user

Post by francisjeffy »

Scenario:- When two users login with the same login information, The first user will get logged of showing a message "you have been logged out because you logged in to a different computer", and the second user will be logged in.

This scenario will be useful in certain cases where only one session is allowed for a login.

Solution

-> Store the login session into a table.
-> Update the login session in the table for each login.
-> Compare current login session with the login session value in the table
-> If both are same, continue, and if they are different log off User.


Hope it helps,

jeF
User avatar
Zoxive
Forum Regular
Posts: 974
Joined: Fri Apr 01, 2005 4:37 pm
Location: Bay City, Michigan

Re: Handling multiple login session from the same user

Post by Zoxive »

I'm not sure what this post is for.

Are you having problems implementing this system or are trying to help others?
francisjeffy
Forum Newbie
Posts: 17
Joined: Fri Feb 29, 2008 12:10 pm

Re: Handling multiple login session from the same user

Post by francisjeffy »

Sorry for the confusion, thats a solution.

That was a problem I faced recently, and figured out a solution for it, thought it might be useful for someone...

jeF
Post Reply