Auto logout

From: Date: Tue, 15 Mar 2005 18:06:33 +0000
Subject: Auto logout
Groups: php.general 
Request: Send a blank email to php-general+get-210836@lists.php.net to get a copy of this message
Hi I wanted to implement an auto-logout feature for my project so that if a terminal is left unattended for say 10 minutes, it should automatically logoff the user. Apart from this, there is another problem that I am encountering with my authentication scheme, the scene is as follows : (1) I am using a $_SESSION variable to transfer the username across pages, what happens is that I cannot login more than one user from the same machine since if i try the same the SESSION[username] variable's value gets changed to the most latest login name. How do i get around this ? (2) Secondly, What happens is, when the user logs off from the system, there are two things that happen at that time, first is that the session variable is killed manually. The second is that the logged in status of the user is updated in the database. So what happens is that when the user is logged on the system, the database shows the user logged in status as 1 otw it shows it as 0. Now the problem is that if by chance the user closes the current browser window without actually logging off, the session variable gets killed automatically but the database is not updated accordingly. Please suggest some way around this also. I would be really happy if you guys can help me with this. Thanks in advance Vaibhav

« previous php.general (#210836) next »