logging in twice with one user account



Is there a way to prevent one user-account from logging in twice on the
same system when using sessions?

I also put the session of a user in a mysql database :

CREATE TABLE `login_sessions` (
`login_id` int(10) unsigned NOT NULL auto_increment,
`login_session_id` varchar(32) NOT NULL default '',
`login_user_id` int(10) unsigned NOT NULL default '0',
`login_date` int(14) unsigned NOT NULL default '0',
PRIMARY KEY (`login_id`)
) ENGINE=MyISAM AUTO_INCREMENT=154 DEFAULT CHARSET=utf8
AUTO_INCREMENT=154 ;

I can check whether the user_id is already in the database, but what if
the user doesn't log out properly?

Any tips, or links to articles about this?

Thanks!

.



Relevant Pages

  • Re: Sessions and AOL
    ... in a MySQL database. ... the username and password is checked in the ... page I simply check that the sessions have been set and carry on. ... All this works fine except for users on AOL. ...
    (comp.lang.php)
  • Re: Sessions and AOL
    ... in a MySQL database. ... page I simply check that the sessions have been set and carry on. ... an AOL user could effectively have a different ip number after ... All the test files are displayed above including the include file. ...
    (comp.lang.php)
  • Re: Sessions Question
    ... > MySQL database the site uses. ... The sessions are not being terminated in a timely ... > and is causing it to fail. ... <?php echo 'Just another PHP saint'; ...
    (comp.lang.php)
  • Re: Session OnEnd
    ... Thanks, for your suggestions, they certainly have given me food for ... "Explicit logoffs by the user" I don't see as an option - you know ... certainly warming to the idea of using my MySQL database to store ... If I was to continue using files to save sessions is there any way I ...
    (comp.lang.php)
  • Re: passing data from page to page
    ... their id from the MySQL database to a session together with a ... personal details, it will search the database for the id that is ... I've also looked at sessions but in my testing, ... wants to store a cookie. ...
    (alt.php)