Skip to main content

How to set Session timeout time in Asp.net(C#).

Here I will explain how to set Session timeout time in Asp.net(C#).
There are two type to set Session timeout Time.

1. In Web.config file we can set session timeout.

<configuration>
<system.web>
 <sessionState mode="InProc" cookieless="UseCookies" timeout="1440" regenerateExpiredSessionId="true">
 </sessionState>
 </system.web>
</configuration>



2.In  Global.asax file we can set session timeout in Session_Start event.

void Session_Start(object sender, EventArgs e)
{
Session.Timeout = 15;
}

Comments