Re: setcookie

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



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

--
PHP Database Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php


[Index of Archives]     [PHP Home]     [PHP Users]     [Postgresql Discussion]     [Kernel Newbies]     [Postgresql]     [Yosemite News]

  Powered by Linux