note 61001 added to function.setcookie

From: Date: Mon, 23 Jan 2006 07:06:30 +0000
Subject: note 61001 added to function.setcookie
Groups: php.notes 
Request: Send a blank email to php-notes+get-102263@lists.php.net to get a copy of this message
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 ;-) ---- Server IP: 147.32.160.17 Probable Submitter: 69.70.135.121 ---- Manual Page -- http://www.php.net/manual/en/function.setcookie.php Edit -- http://master.php.net/manage/user-notes.php?action=edit+61001 Delete: added to the manual -- http://master.php.net/manage/user-notes.php?action=delete+61001&report=yes&reason=added+to+the+manual Delete: bad code -- http://master.php.net/manage/user-notes.php?action=delete+61001&report=yes&reason=bad+code Delete: spam -- http://master.php.net/manage/user-notes.php?action=delete+61001&report=yes&reason=spam Delete: useless -- http://master.php.net/manage/user-notes.php?action=delete+61001&report=yes&reason=useless Delete: non-english -- http://master.php.net/manage/user-notes.php?action=delete+61001&report=yes&reason=non-english Delete: already in docs -- http://master.php.net/manage/user-notes.php?action=delete+61001&report=yes&reason=already+in+docs Delete: other reasons -- http://master.php.net/manage/user-notes.php?action=delete+61001&report=yes Reject -- http://master.php.net/manage/user-notes.php?action=reject+61001&report=yes Search -- http://master.php.net/manage/user-notes.php

« previous php.notes (#102263) next »