Sessionstate模式问题 [英] Sessionstate mode issue

查看:133
本文介绍了Sessionstate模式问题的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我最近将会话状态模式从'inproc'更改为'stateserver'。

现在我丢失了通过.ashx HttpHandler文件在HttpContext.Current.Session中添加的值。 Handler.ashx实现了System.Web.SessionState.IReadOnlySessionState接口。



当我将会话状态模式更改为'InProc'时,通过Session添加的值处理程序可用于以后的请求。

但是,当我将会话状态模式设置为StateServer时,似乎这些值在其他页面中不可用。

有人可以让我知道为什么会发生这种情况以及相同的解决方案。

I have recently changed the session state mode from ‘inproc’ to ‘stateserver’.
Now I am losing the values added in HttpContext.Current.Session via a .ashx HttpHandler file. The Handler.ashx has System.Web.SessionState.IReadOnlySessionState interface implemented.

When I change the session state mode to ‘InProc’, the values added to the Session via the Handler are available for later requests.
However, when I set the session state mode to ‘StateServer’, it seems that the values are not available in other pages.
Could someone please let me know why this is occurring and the solution for the same.

推荐答案

Step 1: In System.Web configuration section of web.config add following

<sessionState cookieless="UseCookies" timeout="1440" mode="StateServer" />

Step 2: From Control Panel => Administrative tools => Services, start the service called as "ASP.NET State Service"

thats it.


这篇关于Sessionstate模式问题的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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