开发者

IIS Session Timeout vs ASP.NET Session Timeout

In IIS 6 (and other versions too afaik), there is a Session Timeout setting in Properties -> Home Directory Tab -> Configuration button -> Options tab. Looks like this:

IIS Session Timeout vs ASP.NET Session Timeout

And in the ASP.NET web.conf开发者_Go百科ig there is a SessionState setting, looks like this:

<system.web>
    <sessionState timeout="120" />
    <!-- etc .. -->
</system.web>

Are they, by any chance, related? Do they set the same thing, or different things?


They are not the same. The IIS session timeout is for clasic ASP pages. The web.config one is for asp.net.


The IIS setting has no effect on ASP.NET sessions as far as I'm aware - these must be set in the web.config.


You should also consider Application Pool Idle Timeout. The settings for the application pool can be found by clicking Properties (IIS 6) or Advanced Settings (IIS 7.5) on the application pool that the application is assigned to.

Ensure this value is set to the timeout of your session, at a minimum, to ensure that all sessions persist for the entire session timeout period.

The reason that these two values are dependent on one another is because the session information is actually stored within the worker process of the application pool. That is to say, if the worker process is shutdown or killed for any reason, the session information will be lost.

0

上一篇:

下一篇:

精彩评论

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

最新问答

问答排行榜