Catch Lost Session

K

Kit Truong

Is there any way in ASP to catch a destroyed session when the user closes
their window.

Example.

- When a user enters a page, I create a session - Session("blah")="blah"
- However when the window is closed, the session is destroyed, but before
it's being destroyed, I want to some things....

Any thoughts?
 
R

Ray at

Kit Truong said:
Is there any way in ASP to catch a destroyed session when the user closes
their window.

Example.

- When a user enters a page, I create a session - Session("blah")="blah"
- However when the window is closed, the session is destroyed,

This is not true.
but before
it's being destroyed, I want to some things....

Sub Session_OnEnd()
'''your code
End Sub

in global.asa in the application root.

Ray at work
 
J

John Blessing

Ray at said:
This is not true.


Sub Session_OnEnd()
'''your code
End Sub

in global.asa in the application root.

Ray at work

session_onend is not a good place to put any code. It doesn't fire reliably.
Better find somewhere else to run code which does any clean up you might
need.

There is no way for the web server to know that you have closed a browser
down.

--
John Blessing

http://www.LbeHelpdesk.com - Help Desk software priced to suit all
businesses
http://www.free-helpdesk.com - Completely free help desk software !
http://www.lbetoolbox.com - Remove Duplicates from MS Outlook
 

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,776
Messages
2,569,603
Members
45,189
Latest member
CryptoTaxSoftware

Latest Threads

Top