Why really short timeout in ASP.NET MVC?

為{幸葍}努か 提交于 2019-12-02 17:34:40

Found the answer finally after a lot of Googling...

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!

2880 is given in minutes. It will logout automatically if you add slidingExpiration="true". See example below.

 <forms loginUrl="~/Account/LogOn" timeout="2880" slidingExpiration="true"/>
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!