note 74544 rejected from function.setcookie by bjori
| From: | bjori@php.net | Date: | Tue, 17 Apr 2007 09:34:52 +0000 |
| Subject: | note 74544 rejected from function.setcookie by bjori | ||
| References: | 1 | Groups: | php.notes |
| Request: | Send a blank email to php-notes+get-125508@lists.php.net to get a copy of this message | ||
Note Submitter: andy at isminc dot com
----
I've seen so many things involving setcookie and the location header... the workaround
I've found is to add an echo "\n"; - it looks like a cookie is only set if there is
content in the page
setcookie("test", 5);
header("Location: /");
- cookie is not set
setcookie("test", 5);
header("Location: /");
echo "\n";
- cookie is set
hope this helps