
05-03-2009
|
|
|
|
IE8 BUG - Cookie Expiration
I found a bug in IE8 in the way it handles the expiration dates. I'm
developing an ASP.NET MVC website and was implementing login/logout. It all
worked great on IE7, FireFox, and Chrome. However, in IE8, I couldn't log out.
I had been using the "DIEYOUGRAVYSUCKINGPIGDOG" approach when expiring my
cookies. Instead of setting the expiration date to DateTime.Now.AddDays(-1),
I was going overboard with DateTime.Now.AddYears(-50). However, it appears
that IE8 did not like the 1959 date. It wouldn't just ignore the expiration
date, it didn't seem to process the cookie at all, as I was also changing the
cookie value, but subsequent requests were not showing that the value changed.
After playing with Fiddler for a few hours, I decided to try changing that
to the more conventional .AddDays(-1), and wouldn't you know, that worked.
The authentication cookie was being expired, and all was good.
I don't really feel like figuring out how far back the expiration date is
processed correctly, but this should help repro the issue.
|