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
worked prefectly.
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.
Hy,
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.
See also JavaScript cookies, it has more explanations and a nice example (which works)
Hy,
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.
See also JavaScript cookies, it has more explanations and a nice example (which works)
Thanks
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?
Bookmarks