two question about cookies :
1. I'm learning about JS cookies from the W3 site
In the example they told to assign the toUTCString() method
to the date object, I guess its because the cookie object
can get only strings.
But when i tried to assign the 'document.cookie' a regular
date object, 'Without using toUTCString()', everything was
So, Do i have to convet the dat object to string?
(maybe its a browser compatible issue)
2. Why the script above (from w3) didn't work
in some browsers at my computer (it worked perfectly when
i upload it to some server in all browsers)?
In my computer, It didnt works in chrome and in opera.
Thanks for your answers
The value of document.cookie property must be a string, in the following format:
document.cookie = "name=value";
- You can’t have spaces, commas, or semicolons inside the string.
Last edited by MarPlo; 05-11-2011 at 11:44 AM.
Originally Posted by MarPlo
That what i'm asking - If the value must be a string, So why
everything is fine when i assign an object type in the cookiie property?
Users Browsing this Thread
There are currently 1 users browsing this thread. (0 members and 1 guests)