ASP.NET MVC FormsAuthentication Cookie超时不能增加 [英] ASP.NET MVC FormsAuthentication Cookie timeout cannot be increased
问题描述
使用默认的ASP.NET MVC模板,我不知道如何增加FormsAuthentication超时。似乎总是使用30分钟。
Using the default ASP.NET MVC template, I cannot figure out how to increase the FormsAuthentication timeout. It seems to always use 30 minutes.
我按照Scott Gu的建议从这篇博文,但它似乎没有什么区别。有人有建议吗?
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?
他的建议是在web.config文件中设置超时值:
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.
我找到了此链接并生成一个机器密钥放入web.config。一旦我这样做,超时值生效。
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屋!