I'm developing a chat room that will have a list of users who are logged-in
Logging out can be done by clicking "log-out" or by simply closing the web
browser
How would one detect that the client's browser is no longer open to the chat room, if they decide to just close the browser instead of clicking the
"log-out" link?
Thanks,
Darren
php chat room login/logout problem
Moderator: General Moderators
- hob_goblin
- Forum Regular
- Posts: 978
- Joined: Sun Apr 28, 2002 9:53 pm
- Contact:
- hob_goblin
- Forum Regular
- Posts: 978
- Joined: Sun Apr 28, 2002 9:53 pm
- Contact:
- hob_goblin
- Forum Regular
- Posts: 978
- Joined: Sun Apr 28, 2002 9:53 pm
- Contact:
i never saw a php chat room as being a good idea. using refresh tags are annoying unless you're printing in flash, but IMHO i'd still stick to java for chat rooms.
as for the unload tag being more accurate, i'd say that THAT would be the backup for the more accurate comparing of the times. relying on a client to log himself out isn't accurate at all. if they don't have javascript enabled, or just closes the page and closes the loaded page on unload before the logout takes place then you still have a person logged in that has already left, where as if you have a set timeout period and compare his last action to that time, you are almost certain to drop all of the people who just left w/o logging out.
stick to flash or java for the printing to be sure you get rid of them though. strictly php/html display is a bad idea. even if you use the timeout idea. having a short set timeout period would mean people would have to talk alot or they get removed. having a long timeout period would mean that if someone left right after their last statement and the unload script didn't go through, you have someone in your chat room that has left long ago.
as for the unload tag being more accurate, i'd say that THAT would be the backup for the more accurate comparing of the times. relying on a client to log himself out isn't accurate at all. if they don't have javascript enabled, or just closes the page and closes the loaded page on unload before the logout takes place then you still have a person logged in that has already left, where as if you have a set timeout period and compare his last action to that time, you are almost certain to drop all of the people who just left w/o logging out.
stick to flash or java for the printing to be sure you get rid of them though. strictly php/html display is a bad idea. even if you use the timeout idea. having a short set timeout period would mean people would have to talk alot or they get removed. having a long timeout period would mean that if someone left right after their last statement and the unload script didn't go through, you have someone in your chat room that has left long ago.
- hob_goblin
- Forum Regular
- Posts: 978
- Joined: Sun Apr 28, 2002 9:53 pm
- Contact: