ASP.NET MVC FormsAuthentication Cookie超时不能增加 [英] ASP.NET MVC FormsAuthentication Cookie timeout cannot be increased

查看:336
本文介绍了ASP.NET MVC FormsAuthentication Cookie超时不能增加的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

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

我跟随斯科特谷的从这个博客帖子建议,但它似乎不有所作为。有没有人有一个建议?

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

 <&的System.Web GT;
    <身份验证模式=表格>
          <形式超时=2880/>
    < /认证>
< /system.web>


解决方案

我的问题只在我的生产环境在我的虚拟主机发生。

我发现此链接并生成计算机密钥将在web.config中。一旦我这样做,超时值生效。

Using the default ASP.NET MVC template, I cannot figure out how to increase the FormsAuthentication timeout. It seems to always use 30 minutes.

I have followed Scott Gu's recommendation from this blog post, but it does not seem to make a difference. Does anyone have a suggestion?

His suggestion was to set the timeout value in the web.config file:

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

解决方案

My issue was only occurring in my production environment at my web host.

I found this link and generated a machine key to put in the web.config. Once I did that, the timeout value took effect.

这篇关于ASP.NET MVC FormsAuthentication Cookie超时不能增加的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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