1

I have been developing an ASP.NET MVC 4 (with razor) WebApp, that worked great in Debug, and even in Release on my local machine.

Now I uploaded it to the server, and while you are navigating it suddenly, from time to time closes your user session, asking for username and password again.

Any idea of why? Maybe I am losing some configuration or settings requirements, but its driving me mad.

4

2 回答 2

3

看起来您将会话与身份验证混淆了。您可能需要启用FormsAuthentication.SlidingExpiration 属性,这样您就不会自动注销。

<authentication mode="Forms">
  <forms loginUrl="member_login.aspx"
         name=".ASPXFORMSAUTH"
         cookieless="UseCookies"
         requireSSL="true" 
         slidingExpiration="TRUE" />
</authentication>
于 2013-09-06T09:08:04.870 回答
1

我认为您的 Session 会在 20 分钟后过期。看看这里: 什么是 ASP.NET 中的默认会话超时?

此外,您会找到解决问题的方法,即设置会话超时..

于 2013-09-06T08:59:22.300 回答