为什么会这样呢? [英] Why is this so?

查看:99
本文介绍了为什么会这样呢?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

仅当在Web.config文件中将sessionstate模式设置为InProc时,才会引发Session_End事件.如果将会话模式设置为StateServer或SQLServer,则不会引发该事件.
为什么?

The Session_End event is raised only when the sessionstate mode is set to InProc in the Web.config file. If session mode is set to StateServer or SQLServer, the event is not raised.
WHY ?

推荐答案

SessionState是客户端指示符.服务器不知道客户端何时断开连接.因此,将会话状态模式设置为服务器模式时不会发送任何事件.
SessionState is a client-side indicator. The server doesn''t know when the client disconnects. Therefore, there''s no event sent when you set the sessionstate mode to a server mode.


因为在InProce模式下,信息存储在内存中,但是在SQL Server或StateServer模式下,信息将存储在内存中.在存储在数据库中.因此,在SQL Server或状态服务器模式下,会话由SQL Server数据库处理.但是在InProc模式下,ASP.NET会话状态的工作方式与经典ASP会话状态类似.

请参阅此以获取更多信息:
http://msdn.microsoft.com/en-us/library/ms972429.aspx [ ^ ]
Because in InProce mode the information is stored in memory but in SQL Server or StateServer mode the information in stored in database. So in SQL Server or State Server mode the session is handled by SQL Server database. But in case of InProc mode the ASP.NET session state works in a similar manner to classic ASP session state.

See this for more information:
http://msdn.microsoft.com/en-us/library/ms972429.aspx[^]


在使用其他进程存储会话状态时,IIS不知道会话何时结束(因为它没有耦合,因此IIS不再保留会话状态).

此处中查看此讨论> [ ^ ].
When using a different process to store the Session State, the IIS does not know when the session ends(because it is not coupled, the session state is not held by the IIS anymore).

Have a look at this discussion here[^].


这篇关于为什么会这样呢?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆