在进程内会话状态模式只支持Session_OnEnd事件模式 [英] In Process session state mode is only mode that supports Session_OnEnd event

查看:192
本文介绍了在进程内会话状态模式只支持Session_OnEnd事件模式的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我读了在ASP.NET的会话状态模式2 MSDN文章。 1 并的 2

I read two MSDN articles on Session state modes in ASP .Net. 1 and 2.

这两篇文章表明,在处理'会话状态模式是支持Session_OnEnd事件的唯一模式。如果会话状态模式是的StateServer或SQLServer的,然后在Global.asax文件的Session_OnEnd事件将被忽略。如果会话状态模式设置为自定义,然后为Session_OnEnd事件支持由自定义会话状态存储提供者来决定。

Both articles shows that 'In Process' session state mode is the only mode that supports the Session_OnEnd event. If the session state Mode is StateServer or SQLServer, then the Session_OnEnd event in the Global.asax file is ignored. If the session state Mode is set to Custom, then support for the Session_OnEnd event is determined by the custom session-state store provider.

任何人都可以给我任何理由为什么它会忽略Session_OnEnd事件进行的StateServer或SQLServer的模式?

Can anyone please give me any reason why it will ignore Session_OnEnd event for StateServer or SQLServer modes?

推荐答案

我认为性能是主要问题。在所有,但是InProc模式,有几个Web服务器响应请求和1服务器(可能被集群SQL)处理的状态。

I think that performance is the main issue. In all but the InProc mode, there are several Webservers responding to requests and 1 Server (Might be clustered SQL) handling the state.

现在,会是谁负责处理超时?它必须是国家服务器,但我们要负担该服务器尽可能少。而这需要国家的服务器将数据推到一个(随机)Web服务器,其他一切被轮询。我怀疑,目前国家甚至服务器保持的Web服务器的列表,他们并不需要。所以,只是为了SeesionEnd事件,这将是必要添加用于给药的复杂系统的网络服务器的监视。

再加上复杂的跟踪选定的服务器是否确实完成事件,这一切变得非常缺乏吸引力。

Now, who would be responsible for handling the timeout? It would have to be the State server, but we want to burden that server as little as possible. And it would require the state server to Push data out to a (random) webserver, for everything else it is Polled. I doubt that currently the State server even keep a list of the Webservers, they don't need to. So, just for the SeesionEnd event, it would be necessary to add a complex system for administration an monitoring of WebServers.
Add to that the complexity of tracking whether the selected server did indeed complete the event and it all becomes very unattractive.

这篇关于在进程内会话状态模式只支持Session_OnEnd事件模式的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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