NYCPHP Meetup

NYPHP.org

[nycphp-talk] Problem With Making Cookies

Rolan Yang rolan at omnistep.com
Thu Apr 13 22:05:11 EDT 2006


If you are just looking to store arbitrary data in the cookie, you might 
want to serialize() the array before storing it. That should take care 
of any conflicting delimiter issues.

~Rolan

IAlsoAgree at stny.rr.com wrote:
> I have a script that creates a cookie. The text for the cookie is
> created like this (I previously used implode and got the exact same
> problem I'm about to describe):
> $cookiedata = $infoarray[0].'#'.$infoarray[1].'#'.$infoarray[2];
>
> However, when I actually check the data inside the cookie, it's saved
> not with pound signs in between the data, but instead with %23. I've
> tried using commas, new line characters, hyphen, and all of them return
> some kind of % character, usually %2C. Is there something I'm not doing
> correctly?
>
> PHP.net says to use implode and a character as the glue, but it doesn't
> matter what character I choose for the glue, it always gets changed into
> a % character (I've only tried characters that are pratical, letters and
> numbers will not be pratical for me as glue) and I can't retrieve the data.
>
> What can I do?
>
> -Joe
>
>   



More information about the talk mailing list