views:

460

answers:

1

Hi,

Im working on a web project in ASP .NET MVC 2.

In this project we store some info inside an ecripted cookie (the ASPXAUTH cookie) to avoid the need to query the db for every request.

The thing is the code for this part has suddenly stopped working.

I reviewed the changes made to the code on the source control server for anything that could be causing it, I found nothing. I even reverted to a known working copy (working on some other persons PC, same code, etc) but after debugging, it seems the .ASPXAUTH cookie is not getting saved anymore. Instead the ASP.NET_SessionId cookie is being set... (wich before wasn't)

I changed the web.config file to turn off the sessionState. This eliminated the ASP.NET_SessionId cookie from being set, but it is still not saving the auth cookie.

Ive recently installed some Microsoft Windows XP Updates, but the other person (whos PC runs the application just fine) also did.

After googling, some info i found pointed out to a problem with the expiration date of the cookie. Ether cus the pc didnt have the right time/date (this was not the case) and others cus of the cookie expiration date being wrongly set. (I checked and it is being set correctly)...

The problem persists with other browsers besides the one im using (Chrome) i tried it with IE6.

Any ideas on why this is happening?

Ill continue to post any helpful information i can find.

Thanks in advance.

+1  A: 

This could be that your cookie grew too big. I ran into the same issue. If your cookie becomes too big, it just won't work, depending on the browser of course

MSDN

cookies are usually limited to 4096 bytes and you can't store more than 20 cookies per site. By using a single cookie with subkeys, you use fewer of those 20 cookies that your site is allotted. In addition, a single cookie takes up about 50 characters for overhead (expiration information, and so on), plus the length of the value that you store in it, all of which counts toward the 4096-byte limit. If you store five subkeys instead of five separate cookies, you save the overhead of the separate cookies and can save around 200 bytes.

http://stackoverflow.com/questions/640938/what-is-the-maximum-size-of-a-web-browsers-cookies-key

http://stackoverflow.com/questions/1595872/what-happens-when-cookies-file-exceeds-maximum-size

Stephane
You nailed it, its definitly a size problem. Thanks a lot. :]
kripto_ash