User login, one at a time
Posted: Mon Aug 06, 2007 8:46 pm
I've been using php for a few years now, but this is one problem that Google and my usual searches havent solved for me yet.
I have a system which users can log in and out of, with user info stored in mySQL and passing some cookie-based session data around.
But I want to make sure that when someone logs in as, for example, jose, there can only be one jose logged in at a time. More than one seperate user can be on at once, but not the same user from different locations.
I can think of plenty of ways to keep track of when a user logs in and out and implement this...but the problem is what if a user doesn't properly log out using the log out button, instead just going somwhere else or closing the browser.
That's where all my solutions fall apart.
Does anyone have any suggestions?
I have a system which users can log in and out of, with user info stored in mySQL and passing some cookie-based session data around.
But I want to make sure that when someone logs in as, for example, jose, there can only be one jose logged in at a time. More than one seperate user can be on at once, but not the same user from different locations.
I can think of plenty of ways to keep track of when a user logs in and out and implement this...but the problem is what if a user doesn't properly log out using the log out button, instead just going somwhere else or closing the browser.
That's where all my solutions fall apart.
Does anyone have any suggestions?