Re: setcookie

From: Date: Fri, 05 Sep 2003 14:18:36 +0000
Subject: Re: setcookie
References: 1  Groups: php.db 
Request: Send a blank email to php-db+get-30357@lists.php.net to get a copy of this message
On Friday, Sep 5, 2003, at 08:58 US/Eastern, Hutchins, Richard wrote:
"If you wish to assign multiple values to a single cookie, just add [] to the cookie name. " So if you wanted to set one cookie to hold all of your items, you should be able to setcookie("items[]", item1), setcookie("items[]", item2), etc up to itemN. Then you can access the items as an array in a PHP script. I'm pretty sure that handling your list of items in this manner would allow you to store a large number of items in the same cookie without setting additional cookies and running into the upper limit of 20.
IIRC there is a browser-set limit to the size of a given cookie, around 4k. That's pretty big, but there is a limit and it may vary by browser, so it's to your advantage to keep it short. pjm

« previous php.db (#30357) next »