Cookies and asp.net

I have some csharp code that creates or updates cookies. It works fine on my local asp.net web site when testing. But it doesn't work on the actual web site hosted here on JodoHost. I tried both Internet Explorer and Firefox. The cookie file appears in the list but it is never updated. Has anyone faced a similar problem? What can it be, especially if it works fine on local web site.

Thanks,
Sanjay
 
It could be that the cookie is actually being updated, but that there are multiple cookies with the same name.
Don't ask me how it's possible, it shouldn't be as far as I know, but I've seen it happen. In that case the problem wouldn't be updating the cookie, just that you're reading back a different one..

You can check by enumerating all cookies in the request:

Code:
for (int i = 0; i < HttpContext.Current.Request.Cookies.Count; i++)
{
	if (HttpContext.Current.Request.Cookies[i].Name == "myCookieName")
	{
		// Do something
	}
}

Not sure if this is your problem though, it's fairly obscure and I can only recall seeing it happen in Internet Explorer. You might need to post some actual code :p
 
Thanks for replying. Actually, I was able to debug the problem by using some nice development tools for FireFox. I don't remember exactly but the domain parameter had to e changed to fix this.
 
Back
Top