How do I detect if a session has ended?
Posted: Thu Sep 11, 2003 9:58 am
I am trying to build a simple chatroom, and it's going really well.
However, when it comes to updating the users-online list, I can't figure out how to get the script to figure out if a person has abandoned his/her session
Sofar I've set it up to add a user to a list upon login, i.e. $sql="insert into users_online '{$_SESSION["user"]}' where id=$blah" which works like a charm and a similar removal process when a person logs out. But what if a person doesn't log out, closes his browser or loses the connection?
With thanks for any attention.
Regards,
H
However, when it comes to updating the users-online list, I can't figure out how to get the script to figure out if a person has abandoned his/her session
Sofar I've set it up to add a user to a list upon login, i.e. $sql="insert into users_online '{$_SESSION["user"]}' where id=$blah" which works like a charm and a similar removal process when a person logs out. But what if a person doesn't log out, closes his browser or loses the connection?
With thanks for any attention.
Regards,
H