Increase session timeout to 1 hour in ASP.Net

Last Reply 9 months ago By dharmendr

Posted 9 months ago

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

You are viewing reply posted by: dharmendr 9 months ago.
Posted 9 months 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";