Sesson_End in Global.asax

A

Alex Smotritsky

Session_End doesn't seem to get fired when a user closes their browser
as I thought it would. Since this seems to be the case, how do I execute
code that I want executed when a user closes the browser?
 
A

Andrew de la Harpe

The session end event is not linked to a user closing their browser.
The session end event occurs when the session timer elapses.
You could use some client side code that fires on the window.close event but
you can never be sure that this is going to work.
I think you should re-think you problem. What it is you are trying to
achieve?

A

A
 
A

Alex Smotritsky

A database developer I'm working with wants me to call one of his stored
procedures when a session ends for user tracking/logging purposes.
 
K

Kevin Spencer

What are the "tracking/logging purposes?" The reason I ask is that it may
not be necessary to run the SP when the browser closes. It may indeed be
acceptable to run them when the Session ends, depending upon the specific
requirements.

--
HTH,
Kevin Spencer
..Net Developer
Microsoft MVP
Big things are made up
of lots of little things.
 
A

Andrew de la Harpe

Ok but this doesn't really explain what you or the DBA are trying to achieve
so it's hard to help.
A
 
A

Alex Smotritsky

If I understand correctly, what you're getting at is that in InProc
sessionState mode, some number of minutes (timeout or less) after the
user closes the browser the Session_End event in Global.asax will be
fired so I can run some code then and there?
 
A

Alex Smotritsky

i'm looking for help at a more general level. inproc mode supports
session_end. i want to know if session_end will always get fired when
the session time ends even if a user closes their browser or goes to
another website.
 

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,744
Messages
2,569,480
Members
44,900
Latest member
Nell636132

Latest Threads

Top