PHP string cookie define -


i have string defined like:

define('images_dir',"/portal/images/"); 

after place inside of cookie content becomes

%2fportal%2fimages%2f 

i need string return like:

/portal/images/ 

i'm kinda combining 2 answers mentioned here.

1st

what described default behaviour, php automatically decode original value, don't need urldecode($_cookie['name']);

2nd

you can prevent automatic url encoding using setrawcookie()

docs

note value portion of cookie automatically urlencoded when send cookie, , when received, automatically decoded , assigned variable same name cookie name. if don't want this, can use setrawcookie() instead if using php 5.


Comments

Popular posts from this blog

css - Which browser returns the correct result for getBoundingClientRect of an SVG element? -

gcc - Calling fftR4() in c from assembly -

Function that returns a formatted array in VBA -