note 29201 added to function.setcookie
| From: | geoffrey at nevra dot net | Date: | Wed, 05 Feb 2003 22:04:31 +0000 |
| Subject: | note 29201 added to function.setcookie | ||
| Groups: | php.notes | ||
| Request: | Send a blank email to php-notes+get-43485@lists.php.net to get a copy of this message | ||
when trying to set a cookie with path, don't forget the starting / to the path
the following code won't work and will set a cookie for the domain 'example.compath'
(tested with php 4.2.3 and IE 5.5)
setcookie('foo', 'bar', time()+3600, 'path', 'example.com');
the following code will work:
setcookie('foo', 'bar', time()+3600, '/path',
'example.com');
hope it helps
--
http://www.php.net/manual/en/function.setcookie.php
http://master.php.net/manage/user-notes.php?action=edit+29201
http://master.php.net/manage/user-notes.php?action=delete+29201
http://master.php.net/manage/user-notes.php?action=reject+29201