Increase session timeout to 1 hour in ASP.Net

Last Reply on Feb 21, 2018 01:12 AM By dharmendr

Posted on Feb 21, 2018 01:02 AM

i am write code to maintain session 1 hr but its not maintening 1 hr seesion

Posted on Feb 21, 2018 01:12 AM

Hi akshay806,

You can increase the session timeout in the following ways.


Open your web.config file and under the system.web section add the following.

<sessionState timeout = "60" mode = "InProc" />

Default Session Timeout is 20 minutes. Replace 60 (minutes) with time you wish.

Global.asax file

Under the Session_Start method, set the timeout property of the session to the required value like this.

Session.Timeout = "60";