| 
	
 | 
 Posted by Rik on 04/22/06 12:15 
tomhawkins1@gmail.com wrote: 
> My current log in script saves various bits of data to a session 
> (including a user id). I need to find out via an admin script which 
> users are currently logged in ie their $_SESSION['theuserid'] exists 
> in any of the existing sessions. 
 
I've created a table called "active users", which holds the information of 
recently logged in users & time of last page-request. Time-out is now set on 
15 minutes, depends an what kind of site you have wether is has to be lower 
or higher. 
 
Usesr have to be authenticated on every page-refresh, so it's  pretty simple 
update the time of the last page-refresh and to delete entries where the 
last page-refresh was >15 minutes ago in the same go. 
 
A nice example of a login script I've rummaged through to get some ideas (it 
wasn't exactly what I needed, but has some nice solutions) is 
http://evolt.org/PHP-Login-System-with-Admin-Features by jpmaster77 
 
Grtz, 
--  
Rik
 
  
Navigation:
[Reply to this message] 
 |