Click to See Complete Forum and Search --> : [RESOLVED] Special Characters in a cookie not showing correctly


netfrugal
06-13-2009, 09:27 PM
I am using PHP to write the cookie:


setcookie("mycookie","variable1|variable2|variable3");


All is fine, when I use PHP to read the cookie. However, I also want to use javascript to call and read the cookie. When I do, this is what is translated:

"variable1%7Cvariable2%7Cvarialbe3%7C"

Clearly special characters are not showing as I expected. But PHP is translating it just fine.

Do I need to do something extra in javascript to read the cookie? How are special characters written and read with js?

netfrugal
06-13-2009, 09:40 PM
Solved!

Seems there is an "unescape" function necessary for special characters.