note 88416 added to function.setcookie
| From: | ChuckAnderson at osu1 dot php dot net | Date: | Fri, 23 Jan 2009 06:14:24 +0000 |
| Subject: | note 88416 added to function.setcookie | ||
| Groups: | php.notes | ||
| Request: | Send a blank email to php-notes+get-149681@lists.php.net to get a copy of this message | ||
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'];
?>
----
Server IP: 208.69.120.35
Probable Submitter: 76.25.204.88
----
Manual Page -- http://www.php.net/manual/en/function.setcookie.php
Edit -- https://master.php.net/note/edit/88416
Del: integrated -- https://master.php.net/note/delete/88416/integrated
Del: useless -- https://master.php.net/note/delete/88416/useless
Del: bad code -- https://master.php.net/note/delete/88416/bad+code
Del: spam -- https://master.php.net/note/delete/88416/spam
Del: non-english -- https://master.php.net/note/delete/88416/non-english
Del: in docs -- https://master.php.net/note/delete/88416/in+docs
Del: other reasons-- https://master.php.net/note/delete/88416
Reject -- https://master.php.net/note/reject/88416
Search -- https://master.php.net/manage/user-notes.php