Sesson_End in Global.asax

  • Thread starter Thread starter Alex Smotritsky
  • Start date Start date
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?
 
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 database developer I'm working with wants me to call one of his stored
procedures when a session ends for user tracking/logging purposes.
 
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.
 
Ok but this doesn't really explain what you or the DBA are trying to achieve
so it's hard to help.
A
 
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?
 
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.
 
Back
Top