views:

41

answers:

1

Hi,

I cannot get setcookie to work with IE8. My script works fine in IE7, firefow and Safari, but it doesn't seem to work in IE8 running on Windows7 and I'm getting desperate!

I'm using a very short small test script now:

<?php
$value = 'content';
setcookie("CookieTest", $value, 0);
?>

With Firefox this works fine, the cookie is being created in my temp file folder without any problem. When I run this script in IE8, no cookie is being created. I have even already put Privacy to the lowest level so that all cookies should be accepted. But even then, no luck.

Anyone any idea what could be wrong here?

Thanks, Geert

A: 

Try using Fiddler to see if the Set-Cookie header is being included in the page response, to see if it's a client or server-side issue.

We're recently encountering what may be a bug in IE8 (perhaps introduced in a recent Windows Update?) Occasionally we update a cookie's value using a Set-Cookie header in a HTTP response. The cookie's value is updated, as we can see the new value being sent in the headers of subsequent HTTP requests. But after a couple of seconds, the cookie seems to "disappear" and no subseqent requests contain the cookie.

I can't find anything in our own client-side code that would delete the cookie, and I've traced the requests and responses to the server in Fiddler, and no Set-Cookie header is deleting the cookie either.

We're working around this issue by setting the cookie from Javascript code instead.

mambo