Re: How to use multiple cookie statements
| From: | Michal Migurski | Date: | Mon, 12 Jul 2004 20:22:42 +0000 |
| Subject: | Re: How to use multiple cookie statements | ||
| References: | 1 | Groups: | php.general |
| Request: | Send a blank email to php-general+get-190287@lists.php.net to get a copy of this message | ||
> I have to use cookies, since I am taking a class and it dictates that we
> use cookies, but I can't email my instructor since she never responds.
> So how do I use a cookie to record multiple values? Help would be
> appreciative.a
A few options: use multiple cookies, e.g. setcookie('cookie_a'),
setcookie('cookie_b'), etc. Jordi's suggestion is also good, though I
would suggest using serialize() to make a single string out of your
values, like this: serialize(array('name1' => 'value', 'name2'
=>
'value'). Or, use PHP's built-in session support. The cookie stores a
unique ID, whie the actual values are stored on the server.
---------------------------------------------------------------------
michal migurski- contact info and pgp key:
sf/ca http://mike.teczno.com/contact.html