Reputation:
I have read about a million posts online regarding session timeout in config file and I am near tears. I have the following code in my config file. I have set the timeout to 1 minute as a test. The session does indeed end within 1 minutee however, if I set to 120 (2 hours) which is what i want, the session end after the default time of 20 minutes i believe. Can anyone offer some help.
<?xml version="1.0"?>
<configuration>
<system.web>
<sessionState mode="InProc" cookieless="false" timeout="1" >
</sessionState>
<compilation debug="true"/>
<authentication mode="Forms">
<forms defaultUrl="~/Default.aspx"
loginUrl="~/Default.aspx"
name=".ASPXFORMSAUTH"
slidingExpiration="true"
timeout="1" />
</authentication>
<customErrors mode="Off" />
</system.web>
</configuration>
Upvotes: 4
Views: 24702
Reputation: 7309
If an app pool is idle for 20 minutes it will recycle by default, see image below.
See this Microsoft post about changing the default.
UPDATE
If you do not have access to the IIS Application Pool Settings you can try the adding the following to your web.config
however the recommended approach is via IIS
<configuration>
<system.web>
<sessionState mode="InProc" timeout="120" />
</system.web>
</configuration>
Upvotes: 11