Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Session time out setting in ASP.Net

I have set session time out to 9 hours in web.config file something like this:

“<sessionState mode="InProc" timeout="540" />

But often users complain that they are facing time out in less than 9 hours of inactivity and the time interval after they are timed out also varies.

I was wondering if session time out is dependent on any of the below settings in IIS:

  1. Session time setting
  2. Idle- time out setting for Application pool
  3. Recycling setting.

Please advise. Also, how do I check session time out setting in IIS 7.0?

like image 280
Anutosh Datta Avatar asked Oct 23 '12 08:10

Anutosh Datta


People also ask

Can we set session timeout?

The timeout limit of the session can be set by setting the value of two directives in the php. ini file or using the ini_set() function in the PHP script. The directives are given below. It is used to set the time limit in seconds to store the session information in the server for a long time.


1 Answers

The session will be lost when the ApplicationPool recycles. That's one of the IIS settings that you mentioned. To set only the timeout in the web.config will not be enough. You need to adjust the setting in IIS.

Here is a link I found while I was looking into the same problem.

Also, this question was very useful: Losing Session State

like image 134
mboldt Avatar answered Sep 20 '22 00:09

mboldt