Beefy Boxes and Bandwidth Generously Provided by pair Networks
Perl: the Markov chain saw
 
PerlMonks  

Re: Tracking user exits

by cianoz (Friar)
on Sep 06, 2000 at 15:25 UTC ( [id://31231]=note: print w/replies, xml ) Need Help??


in reply to Tracking user exits

I suppose you track users with cookies: (or at least with a session id somewhere...)

Suppose the cookie expires in $expire seconds (with $expire quite short - say 15 minutes: so $expire = time() + 15 * 60)
each time the user connects $expire = time() + 15 * 60
you write the expire time along with the session ID in your database
at any time you can check if a session is expired (and the user is logged out) by scanning the session database
this can be triggered by a cron job or by user connections.
(obviously you obtain logout time with a resolution of 15 minutes in this case)
look at the implementation of the Session_OnEnd event in Apache::ASP for a good (IMHO) example.

Log In?
Username:
Password:

What's my password?
Create A New User
Domain Nodelet?
Node Status?
node history
Node Type: note [id://31231]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this?Last hourOther CB clients
Other Users?
Others musing on the Monastery: (4)
As of 2024-04-25 14:04 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found