Thursday, September 8, 2011

Increase or Decrease Session Timeout Limit in ASP.NET

In ASP.NET the default session timeout is 20 minutes. To increase or decrease this timeout for an application you just need to add an entry in web.config file in <system.web> section. Like this:

If form authentication is being used then you need to add timeout for forms too as it uses its own. This form authentication timeout will send the user to login page with the session timeout still active (if you have set larger session timeout then forms).
Another way to set session timeout is through IIS. These are the steps for IIS 7.
  1. Open IIS 7
  2. Navigate to your website and select it.
  3. In feature view double click on ASP. See figure 1.
  4. Now find the Session Properties under Services. Expand it and set your desired Time-out there. See figure 2.

Figure 1.


Figure 2


Reference: http://technet.microsoft.com/en-us/library/cc725820%28WS.10%29.aspx

No comments:

Post a Comment