CodingASP.NET Cookie madness

 

Press Ctrl+Enter to quickly submit your post
Quick Reply  
 
 
  
 From:  Ally  
 To:  ALL
36672.1 

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.

0/0
 Reply   Quote More 

 From:  Ally  
 To:  ALL
36672.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
0/0
 Reply   Quote More 

Reply to All    
 

1–2

Rate my interest:

Adjust text size : Smaller 10 Larger

Beehive Forum 1.5.2 |  FAQ |  Docs |  Support |  Donate! ©2002 - 2024 Project Beehive Forum

Forum Stats