View Single Post

  #1 (permalink)  
Old 12-04-2006
gehegeradeaus@gmail.com
 
Posts: n/a
Default 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!

Reply With Quote