Monday, February 21, 2011

How to Increase the Session timeout in ASP.NET

By default the session timeout is 20 minutes for IIS and session variables. Inorder to increase the session timeout you need to do the following changes.

 <system.web>
  <sessionState timeout="540"  mode="InProc" />  <!-- In minutes -->
  </system.web>

and in the IIS seetings changes the following
1. Open Internet Services Manager.
2.  From the Web site Properties, click the Home Directory tab, then click the Configuration... button in the Application Settings section.
3.  On the configuration panel, click the App Options tab and set the session timeout there. 

If your using form authentication then you need to do the following settings and by default the form authentication session timeout is 30 minutes.

<system.web>
    <authentication mode="Forms">
          <forms timeout="50000000"/>  <!-- in minutes -->
    </authentication>
</system.web>

No comments:

Post a Comment