I would like to prevent multiple logins to my system using the same account simultaneously from different machines. I found a solution posted in this forum 3 years ago but i still have questions.
Reference:
http://www.webmasterworld.com/php/3055206.htm
One way to do this would be to save the session id in the db.
So, user comes to your site and is assigned a session id.
If they log in successfuly then save the session id (which is the value stored in the session cookie) in the db in the users table.
For every page they request check that their session id matches the one in the users table.
If it doesn't present another log in screen (and a link to the change password dialog).
If they log in successfully then save the new session id in the db.
1. What is the database structure? where do I save the session id?
2. How do I compar the session id for every page request?
3. How do I know they logged out if they did not click the logout button?