In a Classic ASP application, if I set Session.Timeout = 10 (or similar), can I execute a piece of code when the Session expires?
I would like to clear out values stored in the Application object when the user session ends.
Cheers.
In a Classic ASP application, if I set Session.Timeout = 10 (or similar), can I execute a piece of code when the Session expires?
I would like to clear out values stored in the Application object when the user session ends.
Cheers.
Yes, you can execute code when a session ends. This is what Global.asa is for. In it, you can define actions for certain events, among which is when your session ends.
These are the events you can use:
You'll probably want to use Session_OnEnd. This would be the name of a sub in Global.asa.
Source, and for more information: http://www.w3schools.com/ASP/asp_globalasa.asp