|
Posted by Dikkie Dik on 11/18/73 11:40
Using JavaScript, you could use the onunload event of the body to
contact the server to log out. However, that would also log a user out
if he requests another page of the server.
Or, you could keep refreshing a subframe as a "live" signal.
Mickey wrote:
> Hi all,
>
> Currently I use a timestamp to log users out after 15 minutes of
> inactivity.
> However I also need to log a user out if they have just left the page.
> I need to do this because I store current online users in a database,
> allowing a maximum of 5 users at one time.
>
> I have been looking through the php manual and came across
> session_cache_expire(). This isn't doing what I need either. Am I
> going in the wrong direction with this?
>
> Basically my question is, is there a way to log a user out (and clear
> my user_online database) if they just leave the page?
>
> Thanks in advance for any suggestions.
>
Navigation:
[Reply to this message]
|