users online
Posted: Sun Oct 22, 2006 11:08 pm
I have a password protected website with PHP sessions. How do I show how many people are logged in at the moment?
I have the users last logged in time saved in a database. I could even create a new field for last page visit and update that each time the user visits the next page. First I was thinking showing users as online if their last page visit is no older than five minutes. However that user could log out a second after his/her last page visit, or stay logged in but not refresh or move from a page for hours...
How can it be done?
I have the users last logged in time saved in a database. I could even create a new field for last page visit and update that each time the user visits the next page. First I was thinking showing users as online if their last page visit is no older than five minutes. However that user could log out a second after his/her last page visit, or stay logged in but not refresh or move from a page for hours...
How can it be done?