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.
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
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