Sunday, February 5, 2012

Set Session Timeout in Asp.Net using web.config and IIS
Set Or Manage Session TimeOut In Asp.Net Using Web.Config and IIS



In this post i'm explaining how to set or increase session timeout value in web.config or IIS in Asp.Net.






1. Set session timeout in IIS.



Open IIS manager by typing inetmgr in Start > run in windows.



Right click on websites > Select Properties.











Go to ASP.NET tab, Click on Edit Configuration.




Increase Session TimeOut In asp.Net web.config


Click on State Management Tab, Set Session TimeOut value (In Minutes).





2. Set Session TimeOut in Web.Config



We can set session timeout in SessionState section of web.config file as mentioned below, timeout value is in minutes.




<system.web>
<sessionState mode="InProc" cookieless="false" timeout="15">
</sessionState>
</system.web>


3. Set session timeout in Global.asax




void Session_Start(object sender, EventArgs e)
{
// Code that runs when a new session is started
Session.Timeout = 15;
}

0 comments:

Post a Comment