Reputation: 3298
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"/>
I have checked on the webserver, win 2003, Asp.net state service is not running and also no instance of sql server is running.
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?
Upvotes: 2
Views: 2513
Reputation: 1478
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.
If you would like to use the other modes you should change the InProc to StateServer
or SQLServer
respectively. More details here.
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.
Upvotes: 4