本文介绍了Global.asax的Application_End事件中的访问会话变量的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
当程序执行开始Application_Start时,Session_start将从global.asax中调用这些方法.
像这样在程序执行停止时调用哪个方法?以及如何在其中访问会话变量?
我的主要问题是我想在浏览器关闭时清除会话变量.为此,我正在上面尝试.
如果您知道其他更好的解决方案,请提出建议.
在此先感谢.
hi ,
As when program execution starts Application_Start, Session_start these methods from global.asax get called.
Such like this which method is called when program execution stops? and how can i access session variable in this ?
My main problem is i want to clear session variables on browser close. For this i am trying above.
If any else better solution you knows please suggest me.
Thanks in advance.
推荐答案
HttpContext.Current.Session("Session_Name")
这篇关于Global.asax的Application_End事件中的访问会话变量的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!