问题描述
我在web.config中的我需要在随机注销调试应用之一下列会话状态条目
I have the following session state entry in web.config on one of the applications I need to debug on random logouts
<sessionState mode="InProc" stateConnectionString="tcpip=127.0.0.1:42424" sqlConnectionString="data source=127.0.0.1;Trusted_Connection=yes" cookieless="false" timeout="20"/>
我已经在Web服务器上检查,赢2003,Asp.net状态服务没有运行,也没有任何的SQL Server实例正在运行。
I have checked on the webserver, win 2003, Asp.net state service is not running and also no instance of sql server is running.
会是什么根据web.config中此条会话超时。 20分钟?我们必须对使用stateConnectionString这一在Asp.net状态服务运行?
what would the session timeout according to this entry in web.config. 20min? Do we must have the Asp.net state service running for using stateConnectionString?
推荐答案
您已经设置了模式
属性是InProc
,这意味着会议将存储在IIS工作进程中。这意味着,在 stateConnectionString这一
和 sqlConnectionString
很可能被忽略。
You have set the mode
attribute to InProc
, which means that the session will be stored inside the IIS worker process. That means that the stateConnectionString
and sqlConnectionString
are probably ignored.
如果你想使用其他模式,你应该还是分别的SQLServer
的是InProc更改为的StateServer
。更多细节这里 。
If you would like to use the other modes you should change the InProc to StateServer
or SQLServer
respectively. More details here.
使用是InProc会话仍应保存20分钟,但如果你的工作进程回收,默认情况下发生的每29小时,就会失去所有的会话,所以你可能要被使用的StateServer
(ASP.NET状态服务应该启动),或为登录用户管理任务的另一种更持久的选择。
With InProc the session should still be stored for 20 minutes, but If your worker process recycles, which by default happens every 29 hours, it will lose all the sessions, so you probably want to be using the StateServer
(ASP.NET State Service should be started), or another more persistent option for the task of managing logged in users.
这篇关于处理asp.net中的sessionState的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!