online users list
Posted on 2005-04-18
I have a website that has an area for users who can login and make use of some services ... when the user logged in I register a session with his info. And I store a session expire time in the DB for each user (15 min) ... when the user change the page I reset the expire time so if he does not move for more than 15 his session will be destroyed automatically and he will be logged out.
In another area I have to list the online users by listing the ones from my DB which their session expire times are not expired ...
if the user logged out or his session time expire he will not be listed any more in the online users ...
The problem occures if the user closed the window and leave the site ... his session will be destroyed but he will be listed in the online users until his session time ends.
I want to delete him also from the online users the moment he close the window if he did not logout !