问题描述
我在Global.asax.cs的
Session_End方法中有一个带有计数器减法例程的ASP.NET页面:
protected void Session_End(Object sender,EventArgs e)
{
ulong curUsers;
Application.Lock();
curUsers =(ulong)应用程序[" curUsers"];
curUsers - ;
应用程序[" iCurUsers"] = curUsers;
Application.UnLock();
}
基本上,这应该通过跟踪打开会话的数量来跟踪登录系统的用户数量 -
,但Session_End NEVER会触发。我已经检查了我的web.config文件
,它确实将模式显示为InProc:
< sessionState
mode =" InProc"
stateConnectionString =" tcpip = 127.0.0.1:42424"
sqlConnectionString =" data source = 127.0.0.1; Trusted_Connection = yes"
cookieless =" false"
timeout =" 20"
/>
还有其他我错过的东西吗?
I''ve got an ASP.NET page with a counter subtraction routine in the
Session_End method in the Global.asax.cs:
protected void Session_End(Object sender, EventArgs e)
{
ulong curUsers;
Application.Lock();
curUsers = (ulong)Application["curUsers"];
curUsers--;
Application["iCurUsers"] = curUsers;
Application.UnLock();
}
Basically, this is supposed to keep track of the number of users that are
logged into the system by keeping track of the number of open sessions --
except that the Session_End NEVER fires. I''ve checked my web.config file
and it does show the mode as InProc:
<sessionState
mode="InProc"
stateConnectionString="tcpip=127.0.0.1:42424"
sqlConnectionString="data source=127.0.0.1;Trusted_Connection=yes"
cookieless="false"
timeout="20"
/>
Is there something else I missed??
推荐答案
发生
分钟
登录系统的用户数量打开的会话数 - 除了Session_End NEVER触发。我检查了我的web.config文件,它确实将模式显示为InProc:
< sessionState
mode =" InProc"
stateConnectionString =" tcpip = 127.0.0.1:42424"
sqlConnectionString =" data source = 127.0.0.1; Trusted_Connection = yes"
cookieless =" false" ;
超时=" 20"
/>
我还错过了其他什么吗?
are logged into the system by keeping track of the number of open sessions -- except that the Session_End NEVER fires. I''ve checked my web.config file and it does show the mode as InProc:
<sessionState
mode="InProc"
stateConnectionString="tcpip=127.0.0.1:42424"
sqlConnectionString="data source=127.0.0.1;Trusted_Connection=yes"
cookieless="false"
timeout="20"
/>
Is there something else I missed??
这篇关于Session_End永远不会触发的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!