Event that handle "close browser"

M

Metallica

Hi,

i made a log system that register when the user logs in and out.

I want know wich event is responsable to catch when the user closes the
browser...

i try page_unload event on my pages, but when use the system, it logs every
page that i passed, i my goal is to log when the user closes the browser.

any ideias?
 
I

i. Wiin

Session_End section in the global.asax file is what should be used. But it
is flakey and doesn't capture every closing of browser or end of session.
Good luck.
 
B

bruce barker

there is no server (code-behind) event for browser close, as the browser
does not inform the user. this is why sessions time out.

-- bruce (sqlwork.com)
 
I

i. Wiin

Bruse is correct. There is no way to capture the exact time the user closes
their local browser. So you'll have to wait for the session to expire and
capture it using session_end

If you absolutely MUST capture when the user closes the app, then you'll
have to build your web app an ActiveX or a Java applet (involves a lot of
work). Both of these should give you the ability to pass info back to the
server upon closing of the app by the end-user.

Good luck.
 
B

bruce barker

a java applet won't work, and the active/x control would have to a browser
helper object.

-- bruce (sqlwork.com)
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,769
Messages
2,569,579
Members
45,053
Latest member
BrodieSola

Latest Threads

Top