IIS Session Timeout vs ASP.NET Session Timeout

蓝咒 提交于 2019-11-26 19:56:59

问题


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:

And in the ASP.NET web.config 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?


回答1:


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




回答2:


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




回答3:


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.



来源:https://stackoverflow.com/questions/1544500/iis-session-timeout-vs-asp-net-session-timeout

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!