ASP.NET Cookie Issues...
I finally got the solution to a cookie issue I've been messing with for the last 2 months. My ISP recently upgraded to Win2K3 server. Everything on my site worked great, except that my cookies expired after 30 minutes. I tried everything, searched high and low and came up against a dead end each time. It didnt help that this wasnt frustrating enough for me to walk across to the ASP.NET team and get one of their devs help me debug this issue - I dont have to log in that often so an expired cookie wasn't that big of a deal. My stats page (http://www.mayahari.com/stats ) doesnt log hits if the user is logged in - but if the cookie expires it would count all my visits as hits which was an error - I dont care how many times I hit my own site :)
I finally got the solution from my ISP this weekend, it appears that they had set the ASP.NET process to restart every 30 minutes. The key used for encryption/decryption is auto-generated by ASP.NET every time the app domain or worker process starts. Whenever the process goes away, a new key is generated. So the cookie cannot be decrypted, the key is invalid.
The workaround is to generate a validationKey and encryptionKey, then set these in your web.config. Here is the KB... http://support.microsoft.com/default.aspx?scid=kb;en-us;Q312906 Hopefully this will help folks out there who see the same issue on the ASP.NET pages with cookie expiration.
**Update: As Eric mentioned in his comment, my scenario is Forms Based Cookie Authentication.