Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Why really short timeout in ASP.NET MVC?

Tags:

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> 

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...

Why is that? Any help appreciated!

like image 978
Anders Avatar asked Oct 22 '10 08:10

Anders


1 Answers

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!

like image 133
Anders Avatar answered Oct 14 '22 18:10

Anders