开发者

overriding the default session time in ASP.NET and IIS

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

I assume the defau开发者_StackOverflow社区lt session time is 20 mins..


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


You could set the Timeout property in web.config:

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


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"

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜