I\'m using forms authentication in an ASP.NET application. I configure the FormsAuthenticationTicket
to expire in 1 year but it actually expires after 1 hour or so.
This is your problem.
ASP will generate a new machine key every time the app pool recycles. Which could reasonably happen every hour.
The machine key is used to encrypt and decrypt your FormsAuthentication cookie. If it changes, the cookie on your browser is no longer any good. So the system will treat you as if you have never logged on.
Try generating a static key and adding it to the configuration file. Should look something like this:
Generate yourself a key here.