note 96251 added to function.setcookie
| From: | HjalmarW at osu1 dot php dot net | Date: | Wed, 17 Feb 2010 11:48:01 +0000 |
| Subject: | note 96251 added to function.setcookie | ||
| Groups: | php.notes | ||
| Request: | Send a blank email to php-notes+get-166053@lists.php.net to get a copy of this message | ||
When setting a cookie on a page that redirects, the cookie must be set after the call to
header('Location: ....');
Such as:
header('Location: http://www.site.com/');
setcookie('asite', $site, time()+60*60, '/', 'site.com');
----
Server IP: 80.67.10.226
Probable Submitter: 83.248.250.55
----
Manual Page -- http://www.php.net/manual/en/function.setcookie.php
Edit -- https://master.php.net/note/edit/96251
Del: integrated -- https://master.php.net/note/delete/96251/integrated
Del: useless -- https://master.php.net/note/delete/96251/useless
Del: bad code -- https://master.php.net/note/delete/96251/bad+code
Del: spam -- https://master.php.net/note/delete/96251/spam
Del: non-english -- https://master.php.net/note/delete/96251/non-english
Del: in docs -- https://master.php.net/note/delete/96251/in+docs
Del: other reasons-- https://master.php.net/note/delete/96251
Reject -- https://master.php.net/note/reject/96251
Search -- https://master.php.net/manage/user-notes.php