note 74126 modified in function.setcookie by danbrown
| From: | danbrown@php.net | Date: | Sun, 17 May 2009 17:51:49 +0000 |
| Subject: | note 74126 modified in function.setcookie by danbrown | ||
| References: | 1 | Groups: | php.notes |
| Request: | Send a blank email to php-notes+get-155033@lists.php.net to get a copy of this message | ||
Be careful of using the same cookie name in subdirectories. Setting a simple cookie
<?php setcookie("region", $_GET['set_region']); ?>
both in the root / and for instance in this case /admin/ will create 2 cookies with different paths.
In reading the cookies back only the first one is read regardless of path.
--was--
Be careful of using the same cookie name in subdirectories. Setting a simple cookie
<?setcookie("region", $_GET['set_region']);?>
both in the root / and for instance in this case /admin/ will create 2 cookies with different paths.
In reading the cookies back only the first one is read regardless of path.
http://php.net/manual/en/function.setcookie.php