fires event and call session.abandon when the browser is closed RRS feed

  • Question

  • User-813421048 posted
    Hi.. Is there anyway to fires Session.Abandon when the browser is closed? I know that we can use javascript function onUnload. <script language="JavaScript"> <!-- function check_close() { alert('Browser is closed'); //Session.Abandon() } //--> </script> <BODY onUnload="javascript:checkClose()"> However, this event will also be fired when the user is redirected to another page/ when the page is reloaded. Actually only when the browser is closed I want to: 1.Call session.Abandon to end the session 2.This session.Abandon will fires session_end() event handler in the global.asax files. 3.Inside session_end handler, I will unlock all the records for current user. Since I set the session timeout to 60 minutes it's impossible for me to wait until the session is over to unlock all records when the user just close the browser and go. Any suggestion is most welcomed. Thank you in advanced. Sincerely Agustina
    Tuesday, September 23, 2003 3:56 AM

All replies

  • User1477435862 posted
    This is a common problem and one that, unfortunately, doesn't really have a solution. You could use a frame that has one row/column (which contains the rest of your site) and use the onunload event in the frame, however this is not a particularly attractive solution.
    Tuesday, September 23, 2003 7:43 AM