Click here to Skip to main content
14,872,753 members
Please Sign up or sign in to vote.
5.00/5 (2 votes)
See more:
Hi,

I want to logout a user when browser window is closed so as to set its status "offline" in the database.

It is quite easy to set the status "offline" when user clicks the logout button.

But, the problem comes when the browser window is closed or the session timeout expires for that user.

with regards,

Bunniy...
Posted
Updated 3-Jan-11 21:41pm
v2
Comments
Amit Kumar Tiwari 4-Jan-11 0:22am
   
Beautiful and most wanted question for web developers.
Dalek Dave 4-Jan-11 3:41am
   
Edited for Grammar and Readability.
And a good Question!

   
v2
Comments
bunniy 4-Jan-11 0:44am
   
Thanks for your answer..

much appreciated..
Dalek Dave 4-Jan-11 3:41am
   
Good Links!
Amit Kumar Tiwari 6-Jan-11 4:47am
   
Thanks Bunniy and Dave.
Also have a look at this: How can I detect the browser close event[^]
   
Comments
Dalek Dave 4-Jan-11 3:42am
   
Good Call.
bunniy 8-Jan-11 7:50am
   
Thanks :)

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)




CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900