Session Time Out in Asp.net 4.0 on IIS 7.5

无人久伴 提交于 2019-12-02 04:43:13

问题


I want to set timeout for my web application for 12 hours.

I have done setting in web.config file as:

<system.web>
     <sessionState timeout="720" />
</system.web>

As suggested in the following post:

  • I came to know that the Application Pool recycles in every 20 minutes (if the pool is ideal).
    And I also checked for changing the application pool time out using one question about application pool timeout setting
  • But still the session time-out is not set to 720 minutes. Do I need to change machine.config file for changing the session time out.
    But I think the properties of machine.config file should be overriden by web.config file.

Kindly provide me some idea.


回答1:


You can try out WMI(Windows Management Instrumentation) script it can help you.You need to have sufficient priveleges to implement the Script.

follwing are the links you can check to get more information.

http://bendera.blogspot.in/2010/12/configuring-ica-rdp-timeout-values.html

http://technet.microsoft.com/en-us/library/cc771956%28v=ws.10%29.aspx




回答2:


You should set all following:

Application Pool / Advanced Settings. There the option Idle Timeout should be set in minutes.

Then within the web.config file in system.web section you should also set the Authentication/Forms, SessionState and RoleManager timeouts, if applicable.


<authentication mode="Forms"><forms loginUrl="~/default.aspx" name=".ASPXFORMSAUTH" timeout="120" /></authentication>

<sessionState cookieless="AutoDetect" cookieName="TYS_ADMIN_SessionId" timeout="120" />

<roleManager ... cookieTimeout="120" defaultProvider="GMRoleProvider" enabled="true">...</roleManager>


来源:https://stackoverflow.com/questions/12756910/session-time-out-in-asp-net-4-0-on-iis-7-5

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