http://qs1969.pair.com?node_id=31212


in reply to Tracking user exits

Short answer: you can't. The only thing you can do is see when they last logged in or, if they have static IP or if you are tracking by cookies, you can also see the last time they have requested a resource, but that's about it.

Regarding Perlmonks, I heard someone mention that what it does is see who has made a request in the last two minutes (maybe taking the tail of the Web access log or something?) and then lists those users in the Other Users box. Perhaps when you make a request it updates a timestamp in the user record in the database? Then it would be a simple SQL statement like SELECT userID WHERE lastVisit > blah, blah, blah.

In short, you can't know when someone has left. You can only know when they last arrived.

Cheers,
Ovid

Update: Hmmm... seems like puck has been paying more attention than I :)