I have a chat room. Members must log-in to access the chatroom. I am trying to work out how to check if member is still in the chatroom or has left.. either by loging-out (I can sort that bit out) or by closing the browser/jumping to another site (which I'm having trouble with)
Any ideas or pointers?
Thanks.
Tracking Users
Moderator: General Moderators
- hob_goblin
- Forum Regular
- Posts: 978
- Joined: Sun Apr 28, 2002 9:53 pm
- Contact:
- gite_ashish
- Forum Contributor
- Posts: 118
- Joined: Sat Aug 31, 2002 11:38 am
- Location: India
Working with jason's suggestion:
1. When a user logs in the site, set a variable to the login time.
2. Upon each access, compare the variable set in 1 to the current time, if the difference is greater than your timeout limit, log out the user
3. For those that just leave the site, or close the browser (crashes not withstanding) try a combination of things:
3a. Use an unLoad javascript tag to close the user session
3b. Have the session perform clean-up duties when it times out
There are probably other ways besides the ones mentioned.
1. When a user logs in the site, set a variable to the login time.
2. Upon each access, compare the variable set in 1 to the current time, if the difference is greater than your timeout limit, log out the user
3. For those that just leave the site, or close the browser (crashes not withstanding) try a combination of things:
3a. Use an unLoad javascript tag to close the user session
3b. Have the session perform clean-up duties when it times out
There are probably other ways besides the ones mentioned.