Posted by Gordon Burditt on 10/12/06 00:39
>I have a site accessible via a login system. I would like to track login and
>logout time for every user. I can get the login time no problem - as every
>time someone logs in, a row is added to a mysql table. The problem happens
>with logout as almost no one uses the logout button; rather they just close
>the browser window.
>My question is therefore - am i able to capture the time the browser is
>closed?
No.
>all login data is stored in a session; so is there a way to find out
>the time the session got deleted which would mean user has left ?
The session being deleted does NOT mean the user has left. And the
user may leave WITHOUT closing the browser window (he may type in
a URL, click on a bookmark, etc.) Unless the user is highly motivated
to explicitly log out (like the site contains private info or can
be used to spend real money), the vast majority of logouts are going
to be by timeout.
You also don't get to run code when the session data is about to
be deleted.
[Back to original message]
|