4

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>
1

1 Answer 1

11

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.

Advanced App pool settings

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>
Sign up to request clarification or add additional context in comments.

4 Comments

Thank you. Sorry if I sound stupid (i'm a newby-ish) If this is the case the session is dependant on the users own windows os settings?
That is not possible, this is a setting in the IIS app pool. if you do not have access to the webserver try the session state web.config setting... see updated answer
Thanks everyone for the help. I now understand the idle timeout setting for a browser session is set in the IIS pool on the server which the users terminal is operating, therefore I have decided to bypass the session for the purposes of my log in.
Sorry Ashley that requires 15 reputation apparently.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.