Session_End 上的 asp.net 会话变量 [英] asp.net session variables on Session_End
本文介绍了Session_End 上的 asp.net 会话变量的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
我需要在 global.asax.cs 中的 Session_End 事件上访问 Session 变量,但 HttpContext.Current 为空,因此无法访问任何会话变量.
I need to access Session variables on Session_End event in global.asax.cs, but HttpContext.Current is null, so none of the session variables are accessible.
a) 我可以以某种方式访问用户会话吗,或者
a) Can I access user session somehow differently, or
b) 在 Session_End 之前是否还有其他事件,我可以访问用户的会话变量?
b) Is there any other event jut before Session_End, I could access user's session variables?
推荐答案
HttpContext.Current
在 Session_End
中不可用,但您可以直接访问会话实例this.Session
.
HttpContext.Current
is not available inside of Session_End
, but you can access the session instance directly with this.Session
.
这篇关于Session_End 上的 asp.net 会话变量的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文