Click here to Skip to main content
15,907,001 members
Please Sign up or sign in to vote.
1.00/5 (1 vote)
See more:

I want store User End time in database so need logout time of user When User Click On Logout Button And When User Close The Browser.

Shingala Anil

1 solution

When the user signs out, the Session_End method in the Global.asax method gets fired. You can execute a query in this method to save the log out time of the user.

If the user does not click the log out button and closes the browser, then again the Session_End method gets executed after the predefined time interval (default is 20 mins). So you can say that the logout time can have an error value of +20 mins.

There is a way to capture the close (x) click event in browser too using javascript
Share this answer
Shingala Anil 4-Apr-12 2:42am    
Hey Thanks.

when user click on Browser Close event Then wt i can do for this???
member60 4-Apr-12 2:44am    
thanks for vote

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