9

Using the default ASP.NET MVC template, I cannot figure out how to increase the FormsAuthentication timeout. It seems to always use 30 minutes.

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?

His suggestion was to set the timeout value in the web.config file:

<system.web>
    <authentication mode="Forms">
          <forms timeout="2880"/>
    </authentication>
</system.web>

3 Answers 3

7

My issue was only occurring in my production environment at my web host.

I found this link and generated a machine key to put in the web.config. Once I did that, the timeout value took effect.

Sign up to request clarification or add additional context in comments.

1 Comment

The link loads content in some Asian language. Not English
2

I had the same problem and adding a custom MachineKey with a ValidationKey to the web.config solved the problem. It seems to affect shared hosts.

I used this site to generate a random machine key: http://aspnetresources.com/tools/machineKey

Comments

0

Be sure that you are setting this in the ~/Web.config file and not in the ~/Views/Web.config file. Also, 50 million minutes is approx. 100 years, which might be hitting some date-related overflow in the browser. Try using a more reasonable number like 2 - 3 years (1.5 million minutes).

1 Comment

Those are good suggestions. However, I wasn't actually using the large timeout value. I had it set to something more reasonable like 2 days. As far as the location of the web.config, I do have the setting in the appropriate file. I believe that setting exists by default in the ASP.NET MVC template, so I have not moved it.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.