ASP.NET MVC FormsAuthentication Cookie超时不能增加

标签 asp.net asp.net-mvc cookies forms-authentication

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

我遵循了this blog post的Scott Gu的建议,但似乎没有什么不同。有人有建议吗?

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

<system.web>
    <authentication mode="Forms">
          <forms timeout="2880"/>
    </authentication>
</system.web>

最佳答案

我的问题仅发生在我的Web主机上的生产环境中。

我找到了this link并生成了一个要放入web.config的机器 key 。一旦执行此操作,超时值即会生效。

关于ASP.NET MVC FormsAuthentication Cookie超时不能增加,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/1663991/

相关文章:

asp.net-mvc - 在 ASP.NET 4.5 和 VS 2012 RC 中将字符串发布到 Web API Controller

asp.net-mvc - 在 ASP.net MVC 中良好且完整地实现 RSS 提要

node.js - Hapijs - 服务器重新启动时 HttpOnly cookie 消失

javascript - 使用 Javascript 获取 Cookie

javascript - PHP可以设置cookie函数,覆盖用JQuery cookie创建的cookie值吗

c# - 将 JavaScript/JSON 数组传递给 MVC 'GET' 方法

c# - 单声道 : Could not load file or assembly 'System.Web.Entity' or one of its dependencies 上的 MVC 5

c# - 多层应用程序中类的推荐命名约定是什么?

JavaScript window.location 不起作用

javascript - 函数未在 Controller 内部定义,AngularJS