eventhandler for session end

Results 1 to 2 of 2

Thread: eventhandler for session end

  1. #1
    cl&ak Guest

    Default eventhandler for session end

    Is there any eventhandler or jscript functions that we can use to detect the ending of a session or closing of the browser window? <BR>

  2. #2
    Olz Guest

    Default RE: eventhandler for session end

    kind of....<BR><BR>When a session expires, typicaly 20min after the last interaction in the session (set with Session.timeout or via the IIS properties) the on_Sessionend (I might be wrong on the name) handler is called in the global.asa file.<BR>You can put code in here that will execute prior to expiring the session.<BR> AS for closing the window, you can put an onclose in the body tag that fires an event in the browser - this event can tickle the server - one way of doing this is to set the src of an image object.#EX.<BR><BR>---BROWSER SIDE---<BR>&#060;html&#062;<BR>&#060;script&#062;<BR><BR> function closeme(){<BR><BR>x = new Image();<BR>x.src="close.asp";<BR>}<BR>&#060;/script&#062;<BR><BR>&#060;body onclose="closeme();"&#062;<BR>blah<BR>&#060;/body&#062;<BR>&#060;/html&#062;<BR><BR><BR><BR>SERVER SIDE close.asp<BR>&#060;% <BR>// do something<BR>%&#062;<BR><BR>you can put some code in the close.asp script to cleanup the session, empty a temp database, delete temp files etc.;<BR><BR>Good luck!<BR><BR><BR>Olz.<BR>

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts