Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Internet Explorer ignoring my cookies

I am having a strange problem with Internet Explorer not accepting my cookies. This is the cookie:

set-cookie: USUSERNAME=LrceSVu6mUJ9Ztmvp4oKSQ%3D%3D; version="1"; expires=Mon, 15-Jun-2009 11:42:21 GMT; path=/; domain=.us.is

It does not get stored for the domain dev-intranet.us.is or any other us.is domain. However setting the domain of the cookie to my dev machines ip address works perfectly:

set-cookie: USUSERNAME=LrceSVu6mUJ9Ztmvp4oKSQ%3D%3D; version="1"; expires=Mon, 15-Jun-2009 08:41:58 GMT; path=/; domain=192.168.34.104

Everything works as expecten in Firefox, Opera, Safari and Chrome but not IE7

Any ideas whats going on here?

Btw. using WebObjects WOCookie to create the cookie.

like image 457
Atli Páll Hafsteinsson Avatar asked May 15 '09 09:05

Atli Páll Hafsteinsson


People also ask

How do I fix cookies on Internet Explorer?

Internet ExplorerClick 'Tools' (the gear icon) in the browser toolbar. Choose Internet Options. Click the Privacy tab, and then, under Settings, move the slider to the top to block all cookies or to the bottom to allow all cookies, and then click OK.

Why are my cookies not setting?

That, or the dough wasn't cool enough before baking. Warm cookie dough or excess butter will cause the cookies to spread too much, baking quickly on the outside but remaining raw in the middle. Next time, chill your cookies in the fridge for 10 minutes before you bake them. If the problem persists, use less butter.


1 Answers

The cookie in your example is for the "us.is" domain. IE ignores cookies set for two-letter domains. To be more exact, it seems to ignore cookies from domains with less than 5 characters (like yours: 2+2).

I remember this bug/feature from IE6 I believe, possibly earlier versions. Reading this, it looks like the behavior is still around in IE7.

An MSKB article suggesting an unpractical workaround can be found here: http://support.microsoft.com/kb/310676.

More practical is perhaps to get a longer domain name ;-) or to make sure users are always redirected to one canonical name, i.e. "www.us.is" and plant your cookies there.

like image 69
conny Avatar answered Sep 23 '22 22:09

conny