note 88416 deleted from function.setcookie by danbrown
| From: | danbrown@php.net | Date: | Fri, 23 Jan 2009 16:17:52 +0000 |
| Subject: | note 88416 deleted from function.setcookie by danbrown | ||
| References: | 1 | Groups: | php.notes |
| Request: | Send a blank email to php-notes+get-149698@lists.php.net to get a copy of this message | ||
Note Submitter: Chuck Anderson
----
I beg to differ about setting cookies as an array:
I have a site (PHP Version 5.2.6) where I set cookies like so:
<?php
setcookie('bdate[month]', $birthmonth, 2147483647, '/',
'.example.com');
setcookie('bdate[day]', $birthday, 2147483647, '/', '.example.com');
setcookie('bdate[year]', $birthyear, 2147483647, '/', '.example.com');
?>
And I am able to retrieve the info in the expected way.
<?php
$birthmonth = $_COOKIE['bdate']['month'];
$birthday = $_COOKIE['bdate']['day'];
$birthyear = $_COOKIE['bdate']['year'];
?>