note 47967 added to function.setcookie
| From: | pineapplecharm at osu1 dot php dot net | Date: | Tue, 07 Dec 2004 15:10:18 +0000 |
| Subject: | note 47967 added to function.setcookie | ||
| Groups: | php.notes | ||
| Request: | Send a blank email to php-notes+get-81490@lists.php.net to get a copy of this message | ||
I have noticed that cookies set by pages run through IE will be set to the root or '/'
directory by default whereas in Mozilla they will set to the directory of the script. This means
that if you set a cookie in /setcookie/index.php and then navigate up the tree to /home.php, a
cookie shows up in the Cookie Manager but is not returned to your script because the directory
doesn't match. What threw me off the scent was that IE worked fine.
This is not a 100% rule - there's something else I'm missing here - but it took me hours
chasing shadows before I thought to force the '/' declaration every time. Problem solved.
----
Manual Page -- http://www.php.net/manual/en/function.setcookie.php
Edit -- http://master.php.net/manage/user-notes.php?action=edit+47967
Delete -- http://master.php.net/manage/user-notes.php?action=delete+47967&report=yes
Reason: bad code -- http://master.php.net/manage/user-notes.php?action=delete+47967&report=yes&reason=bad+code
Reason: spam -- http://master.php.net/manage/user-notes.php?action=delete+47967&report=yes&reason=spam
Reason: useless example -- http://master.php.net/manage/user-notes.php?action=delete+47967&report=yes&reason=useless+example
Reason: contains commercial links -- http://master.php.net/manage/user-notes.php?action=delete+47967&report=yes&reason=contains+commercial+links
Reason: useless note -- http://master.php.net/manage/user-notes.php?action=delete+47967&report=yes&reason=useless+note
Reject -- http://master.php.net/manage/user-notes.php?action=reject+47967&report=yes
Search -- http://master.php.net/manage/user-notes.php