开发者

Session Timeout: Can I Perform Any Actions on Timeout?

开发者 https://www.devze.com 2023-01-17 01:58 出处:网络
In a Cla开发者_运维技巧ssic ASP application, if I set Session.Timeout = 10 (or similar), can I execute a piece of code when the Session expires?

In a Cla开发者_运维技巧ssic 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.


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:

  • Application_OnStart
  • Session_OnStart
  • Session_OnEnd
  • Application_OnEnd

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

0

精彩评论

暂无评论...
验证码 换一张
取 消