note 74126 deleted from function.setcookie by crell
| From: | crell@php.net | Date: | Tue, 12 Apr 2022 00:37:23 +0000 |
| Subject: | note 74126 deleted from function.setcookie by crell | ||
| References: | 1 | Groups: | php.notes |
| Request: | Send a blank email to php-notes+get-218150@lists.php.net to get a copy of this message | ||
Note Submitter: mike
----
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.