View Full Version : Session Ended

06-02-2004, 09:02 PM

As a relative newbie, Im writing a forum script to get some more practice in. Ive mangaed to get a php session started, but I was wondering how you detect the session being terminated?

What Im trying to achive is a list of the users who are currently logged in.

Thank you! Ian.

06-03-2004, 03:01 AM
the only reliable way to spot a user has ended a session without logging out is to keep track of sessions in a DB/flatfile & periodically clean that table out , e.g. everytime $user1 is spotted , update your db to note the time $user1 was spotted , then check for all users who have not been `spotted` for the last $x minutes and remove them from the DB.

06-03-2004, 11:47 AM
Many thanks...