How to: do something on the server when user close the browser?

  • Thread starter Thread starter Feng
  • Start date Start date
F

Feng

Hi,

What I need is to run some ASP code on the server, when
user close his/her browser. I tried to create a "OnUnload"
event handler on client side JavaScript to do a "Submit
()". But that doesn't seem to help.

Can someone help me on this?

Thanks
 
Hi Feng,

You may want to use the Session_End event, which happen some time after the
user closes his/her browser (after the timeout, which has a default of 20
minutes).

If not, you may use a javascript as you guessed, but you would instead have
it to open another window that would call an url on you site to tell that
the browser was closed.
 
Back
Top