为什么在ASP.NET MVC非常短超时? [英] Why really short timeout in ASP.NET MVC?

查看:1179
本文介绍了为什么在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:

<一个href=\"http://aspnetresources.com/tools/machineKey\">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!

这篇关于为什么在ASP.NET MVC非常短超时?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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