ASP.NET mvc auth或会话比设置更快到期 [英] ASP.NET mvc auth or session expires quicker than set

查看:165
本文介绍了ASP.NET mvc auth或会话比设置更快到期的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

在我的ASP.NET MVC5 网站中,web.config中的登录和会话超时如下:

In my ASP.NET MVC5 website the login and session timeout in web.config are as follows:

<system.web>
  <authentication mode="Forms">
    <forms loginUrl="~/Account/Login" slidingExpiration="true" timeout="60"/>
  </authentication>
  <sessionState mode="InProc" timeout="60"/>      
</system.web>

会话或身份验证仍在五分钟内完成。我已经接近我的网络托管服务以增加IIS中的超时,并且他们在增加IIS中的超时后共享了屏幕截图,但没有改变。知道为什么会发生这种情况。

Still the session or authentication times our in five minutes. I have approached my web hosting provide to increase the timeout in IIS and they shared a screenshot after increasing the timeout in IIS, but nothing changed. Any idea why this is happening.

推荐答案

这是IIS中 SystemIdleTime 变量的问题。我请求我的托管服务提供商将此值增加到30分钟,并且它有效。

It was an issue with the SystemIdleTime variable in the IIS. I requested my hosting provider to increase this value to 30 minutes and it worked.

它表示当没有30分钟的请求时,当应用程序池关闭时,我的所有会话变量都将被擦除。该值将覆盖网站web.cofig中设置的会话超时。您可以将其设置为0以指示应用程序池永远不会关闭,然后您可以通过web.config控制会话的超时。我也发现这个很好的 文章 -

It indicates that all my session variables would erase as the application pool shuts down when there is no request for 30 minutes. This value would override the session's timeout set in the website's web.cofig. You could set it to 0 to indicate that the application pool will never shut down and then you could sontrol the session's timeout through web.config. I also found this good article

这篇关于ASP.NET mvc auth或会话比设置更快到期的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆