Controlling When a Session Times Out : sessionState « Sessions « ASP.NET Tutorial






You can specify the Session timeout in the web configuration file or you can set the Session timeout programmatically. 

The following web configuration file changes the Session timeout value to 60 (1 hour).
File: Web.Config

<configuration>
<system.web>

  <sessionState timeout="60" />

</system.web>
</configuration>


You can modify the Session timeout value programmatically with the Timeout property of the Session object. 


Session.Timeout = 60;








11.4.sessionState
11.4.1.Controlling When a Session Times Out
11.4.2.Using Cookieless Session State
11.4.3.If a session ends