note 110428 added to function.setcookie
| From: | SANNER | Date: | Sat, 20 Oct 2012 21:45:45 +0000 |
| Subject: | note 110428 added to function.setcookie | ||
| Groups: | php.notes | ||
| Request: | Send a blank email to php-notes+get-191452@lists.php.net to get a copy of this message | ||
My cookie would work on Firefox but not on IE9 or Safari, until I added "/" to it.
Ex.
$user = "Partner";
$value = $_POST[partner]; //PARTNER ID
$expire = time() + 60*60*24*30*12; //EXPIRES AFTER 1 YEAR
$doman = "mywebpage.com";
setcookie($user, $value, $expire, $doman); <- Would not work
BUT
When I tried
setcookie($user, $value, $expire, "/", $doman);
It worked on IE9 and Safari. Hope it helps, I wasted hours on this problem.
----
Server IP: 69.147.83.199
Probable Submitter: 187.85.174.195
----
Manual Page -- http://www.php.net/manual/en/function.setcookie.php
Edit -- https://master.php.net/note/edit/110428
Del: integrated -- https://master.php.net/note/delete/110428/integrated
Del: useless -- https://master.php.net/note/delete/110428/useless
Del: bad code -- https://master.php.net/note/delete/110428/bad+code
Del: spam -- https://master.php.net/note/delete/110428/spam
Del: non-english -- https://master.php.net/note/delete/110428/non-english
Del: in docs -- https://master.php.net/note/delete/110428/in+docs
Del: other reasons-- https://master.php.net/note/delete/110428
Reject -- https://master.php.net/note/reject/110428
Search -- https://master.php.net/manage/user-notes.php