note 61001 deleted from function.setcookie by nlopess
| From: | nlopess@php.net | Date: | Mon, 23 Jan 2006 11:29:16 +0000 |
| Subject: | note 61001 deleted from function.setcookie by nlopess | ||
| References: | 1 | Groups: | php.notes |
| Request: | Send a blank email to php-notes+get-102284@lists.php.net to get a copy of this message | ||
Note Submitter: PHP at polycoda dot com
----
Internet Explorer 6 and Windows XP bug fix for cookies that do not work:
If you use setcookie() and if your PHP script does not output any HTML and redirects the user, your
cookie will likely not be saved. To make it work for any web browser in any circumstances, I use
this kind of user redirection:
die('<META HTTP-EQUIV="Refresh" CONTENT="1;
URL=next_page_after_setting_cookie.php">');
This line of code will output some HTML, saving the cookie correctly under Windows XP and IE 6, and
then will redirect the user just as fine.
All above solutions did not work for me, including the header() workaround, the false domain
setcookie() argument. Even sessions don't work under IE 6 and Windows XP. All of this works
perfectly in any situation using FireFox, tough.
Hope this helps you guys ;-)