ASP.NET MVC FormsAuthentication Cookie超时无法增加

Yea*_*Stu 9 asp.net cookies asp.net-mvc forms-authentication

使用默认的ASP.NET MVC模板,我无法弄清楚如何增加FormsAuthentication超时.它似乎总是使用30分钟.

我从这篇博文中听过Scott Gu的推荐,但它似乎没有什么区别.有没有人有建议?

他的建议是在web.config文件中设置超时值:

<system.web>
    <authentication mode="Forms">
          <forms timeout="2880"/>
    </authentication>
</system.web>
Run Code Online (Sandbox Code Playgroud)

Yea*_*Stu 7

我的问题只发生在我的网络主机的生产环境中.

我找到了这个链接并生成了一个机器密钥以放入web.config.一旦我这样做,超时值就会生效.