Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

Comma seperated values in cookie?

9 views
Skip to first unread message

Samuel van Laere

unread,
Jul 24, 2010, 10:01:48 AM7/24/10
to
I'm trying to get multiple comma seperated values into a PHP generated
cookie:

<?php
$pid = array('3','59','11','15','93','16','17','20','30','4');
setcookie("expanded_rows", join(",", $pid) ,time()+3600);
?>

This creates a cookie with these strange chars:
3%2C59%2C11%2C15%2C93%2C16%2C17%2C20%2C30%2C4

Any idea what it is i'm doing wrong?

cheers,
Samuel van Laere

__________ Informatie van ESET NOD32 Antivirus, versie van database viruskenmerken 5308 (20100724) __________

Het bericht is gecontroleerd door ESET NOD32 Antivirus.

http://www.eset.com


Peter Bradley

unread,
Jul 24, 2010, 10:54:28 AM7/24/10
to
Ar 24/07/10 15:01, ysgrifennodd Samuel van Laere :

Hi Samuel,

2C is the ASCII code for a comma, and %2C is a comma in URL encoding.

Does that help?

Cheers


Peter

--
http://www.peredur.net

Jerry Stuckle

unread,
Jul 24, 2010, 1:55:47 PM7/24/10
to

Absolutely nothing. That's how most non-alphanumeric characters are sent.

Why does it matter? They are converted back when you get the cookie again.

--
==================
Remove the "x" from my email address
Jerry Stuckle
JDS Computer Training Corp.
jstu...@attglobal.net
==================

Samuel van Laere

unread,
Jul 24, 2010, 1:59:56 PM7/24/10
to

"Jerry Stuckle" <jstu...@attglobal.net> schreef in bericht
news:i2f9f7$3nk$2...@news.eternal-september.org...

>
>
> Absolutely nothing. That's how most non-alphanumeric characters are sent.
>
> Why does it matter? They are converted back when you get the cookie
> again.
>

Thanks Jerry,

indeed the cookie works I did not know it got converted.

cheers,
Samuel

__________ Informatie van ESET NOD32 Antivirus, versie van database viruskenmerken 5309 (20100724) __________

0 new messages