views:

87

answers:

3

How can I change the default session time in an ASP.NET website to something user defined - perhaps 1 hr?

I assume the default session time is 20 mins..

+1  A: 

You could set the Timeout property in web.config:

<sessionState 
    mode="InProc"
    cookieless="false" 
    timeout="60" 
/>
Darin Dimitrov
+4  A: 

you can change in your web.config for application level like..

<sessionState timeout="40"></sessionState>// note this is minutes

and you can also change in your machine.config as well for all application

C:\Windows\Microsoft.NET\Framework\v2.0.50727\CONFIG\machine.config
Muhammad Akhtar
+1  A: 

Yes, you are rigth... If the setting is not explicitly stated, the default timeout value will be 20 minutes.

timeout Setting controls the length of time a session is considered valid. The session timeout, which is specified in minutes, is a sliding value. i.e. on each request, the timeout period is reset to the current time plus the timeout value. Here's an example of how the setting is specified:

timeout="60"