Page 1 of 1

Tracking Users

Posted: Tue Sep 03, 2002 7:29 pm
by Gen-ik
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.

Posted: Tue Sep 03, 2002 7:45 pm
by hob_goblin
i'd use sessions, and session timeouts... but also for quicker access

try the <body onUnload=""> attribute... it will work 85% of the time and help alot

Posted: Tue Sep 03, 2002 11:46 pm
by gite_ashish
hi hob_goblin,

i m very much keen to know about the 15% part for cleanup/user tracking.

i think, after session, session timeout and <BODY unLoad=""> there remains only crash (windows favorite ;-) conditions.... which we can't do much about.

regards,

Posted: Wed Sep 04, 2002 9:14 am
by jason
Well, if a person crashes, their really is nothing the system can do. Basically, the best it can do is after 5 minutes and the chatroom hasn't gotten an update from the person (like with an auto-refresh), the person has "timed out".

Posted: Wed Sep 04, 2002 10:01 am
by Tzicha
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.