为什么在ASP.NET MVC非常短超时?
我所在的超时值设置为2880的MVC 2应用程序(据我所知分钟,但即使是秒有一个问题):
I have an MVC 2 application where the timeout is set to 2880 (minutes as I understand it, but even if it is seconds there's a problem):
<authentication mode="Forms">
<forms loginUrl="~/Account/LogOn" timeout="2880" />
</authentication>
现在这应该然后平均48分,或者至少为48分钟(如果该值为秒)。但用户只要花几个闲置分钟...
Now this should then mean 48 hours, or at least 48 minutes (if the value is seconds). But the user is logged out after as little as a couple of minutes of inactivity...
这是为什么?任何帮助AP preciated!
Why is that? Any help appreciated!
很多的谷歌搜索后找到了答案终于...
Found the answer finally after a lot of Googling...
您必须设置在web.config文件中的自定义的machineKey。我用这个生成器:
You have to set a custom machinekey in the web.config file. I used this generator:
http://aspnetresources.com/tools/machineKey
这似乎已经做的虚拟主机上的循环,这会导致用户被注销,如果我理解正确东西。
This seems to have to do something with "recycling" on the web host, which causes the user to be logged off, if I understood it correctly.
总之,现在工作得很好!
Anyway, it works fine now!