Update Database after session timeout and browser closed.
Does anyone who has the best reference on the subject?, i have search the net but unlucky to get one.
Know the answer? Post it. Somebody with the same question will find it here.
Answer a question in the forums and earn +20 SHARP for every answer.
See unanswered questions
DevSocialUpcoming · 3rd editionAI Agents ConferenceDec 1–3, 2026Live onlineFree to attend5days leftRegister
Krishna GaradRank #191 · 12.8K reputationPosted Jan 4, 2011, 7:29 PM EST
http://www.c-sharpcorner.com/Forums/UploadFile/103930/
Manikavelu VelayuthamRank #413 · 6K reputationPosted Jan 4, 2011, 7:30 PM EST
Browser Closed event can be handled in the OnUnload Event of the body tag in the aspx page.
Put your functionality to update the database in the above two events, that would solve your problem
Herald Suva18 reputationPosted Jan 4, 2011, 7:39 PM EST
Manikavelu VelayuthamRank #413 · 6K reputationPosted Jan 4, 2011, 7:46 PM EST
Herald Suva18 reputationPosted Jan 4, 2011, 7:49 PM EST
Manikavelu VelayuthamRank #413 · 6K reputationPosted Jan 4, 2011, 7:58 PM EST
Herald Suva18 reputationPosted Jan 4, 2011, 8:23 PM EST
Herald Suva18 reputationPosted Jan 5, 2011, 5:48 PM EST
Suthish NairRank #92 · 22.8K reputationPosted Feb 9, 2011, 8:12 AM EST
arun kumar5 reputationPosted Jan 6, 2013, 11:29 PM EST
On the form_load event in every page, write the below code.
Response.AppendHeader("Refresh", "60; URL=../default.aspx")
Default session time out is 20 minutes and I am using "60" seconds for this demo. If there is no activity in this period of time, then it goes back to the default or home page and we send a key to update the database "session key" or any other tag. This way we can possibly know the activity of the user or member.
This worked for me.
You can learn more about sessions here...
http://www.encodedna.com/2012/12/session-variable-in-asp.net-class.htm