Increase session timeout to 1 hour in ASP.Net

Last Reply one year ago By dharmendr

Posted one year ago

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

You are viewing reply posted by: dharmendr one year ago.
Posted one year ago

Hi akshay806,

You can increase the session timeout in the following ways.

Web.config

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";