How to configure the timeout of your ASP.NET web application?

独自空忆成欢 提交于 2020-01-15 13:25:50

问题


My previous experience with ASP.NET web application (regarding the timeout) is that it logouts the user every 30 minutes, regardless of what module is running, Is there a way that we can increase the application timeout to an hour or two?

Any help is highly appreciated, thanks in advance.


回答1:


You can set the Sesion timeout in your web.config file.

<sessionState timeout="60" />

The value is defined in minutes.

I think you can set it programmatically as well from the HttpContext.Current.Session object.




回答2:


If by application timeout you mean session timeout, then this can be done in the web.config. The timeout attribute on the sessionstate element takes an integer that indicates the number of minutes of inactivity before it times out the user's session.

<configuration>
  <sessionstate timeout="20" />
.
.
.
</configuration>



回答3:


In the web.config , set the value of timeout attribute to the value that you need.

<system.web>
    <authentication mode="Forms">
          <forms timeout="value in minutes"/>
    </authentication>
</system.web>



回答4:


There is a value in your web.config where you can set the timeout length.

  <sessionState
    timeout="60"
  /> 


来源:https://stackoverflow.com/questions/435538/how-to-configure-the-timeout-of-your-asp-net-web-application

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