P
Peter Michaux
Hi,
These first three links say that when reading document.cookie the
name-value pairs are separated by semicolons and they show examples
like "name=value;expires=date" where there is clearly only a semicolon
separator.
<http://www.w3.org/TR/2000/WD-DOM-Level-1-20000929/level-one-html.html#ID-1006298752-h2>
<http://www.w3.org/TR/DOM-Level-2-HTML/html.html#ID-8747038>
<http://developer.mozilla.org/en/docs/DOM:document.cookie#Parameters>
The example on Microsoft's site shows that document.cookie.split('; ')
should be used to break up the cookies. This indicates there will
always be a semicolon and space separating the name-value pairs.
<http://msdn.microsoft.com/workshop/author/dhtml/reference/properties/cookie.asp>
I tested Opera, Safari, Firefox, and IE and they all seem to use
semicolon-space.
So what is going on between the standards and the implementations? Are
the standards incorrectly stated? Should code be written to work both
ways or just the semicolon-space way?
Thank you,
Peter
These first three links say that when reading document.cookie the
name-value pairs are separated by semicolons and they show examples
like "name=value;expires=date" where there is clearly only a semicolon
separator.
<http://www.w3.org/TR/2000/WD-DOM-Level-1-20000929/level-one-html.html#ID-1006298752-h2>
<http://www.w3.org/TR/DOM-Level-2-HTML/html.html#ID-8747038>
<http://developer.mozilla.org/en/docs/DOM:document.cookie#Parameters>
The example on Microsoft's site shows that document.cookie.split('; ')
should be used to break up the cookies. This indicates there will
always be a semicolon and space separating the name-value pairs.
<http://msdn.microsoft.com/workshop/author/dhtml/reference/properties/cookie.asp>
I tested Opera, Safari, Firefox, and IE and they all seem to use
semicolon-space.
So what is going on between the standards and the implementations? Are
the standards incorrectly stated? Should code be written to work both
ways or just the semicolon-space way?
Thank you,
Peter