ASP.NET Cookie madness

From: Ally 7 Oct 2009 16:04
To: ALL1 of 2

Anyone clued in with ASP.NET cookie handling?

 

I'm setting a Response.Cookie, which works great. However, as soon as I load a different page (to the one that sets it) the cookie gets erased- looking in the headers I can see that it's manually setting "looktolooksettings=;" - i.e. emptying out the cookie.

 

I can't see any code that's causing this. Is there some mental internal ASP.NET thing that deliberately eats up cookies? It's set with a 30 day expiry, which appears fine. I no understand.

From: Ally 7 Oct 2009 17:26
To: ALL2 of 2
OK, found my answer. For anyone from Google or whatever, turns out that doing:
csharp code:
if (Response.Cookies["blah"] != null)


won't work. Merely checking for the cookie in fact CREATES one with an empty value. Hurrrrr