Bug 14213 - On page with MIME type application/xhtml+xml, document.cookie doesn't work
Summary: On page with MIME type application/xhtml+xml, document.cookie doesn't work
Status: RESOLVED FIXED
Alias: None
Product: WebKit
Classification: Unclassified
Component: DOM (show other bugs)
Version: 523.x (Safari 3)
Hardware: Mac (PowerPC) OS X 10.4
: P3 Enhancement
Assignee: Nobody
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2007-06-18 06:07 PDT by François Lamboley
Modified: 2007-10-06 02:08 PDT (History)
3 users (show)

See Also:


Attachments
An xhtml file to perform test to see whether cookie work or not (1.73 KB, application/xhtml+xml)
2007-06-18 06:13 PDT, François Lamboley
no flags Details

Note You need to log in before you can comment on or make changes to this bug.
Description François Lamboley 2007-06-18 06:07:09 PDT
On page with MIME type application/xhtml+xml (and so very normative), the document.cookie variable is undefined, and we can't get any cookie from that page
Comment 1 François Lamboley 2007-06-18 06:13:38 PDT
Created attachment 15099 [details]
An xhtml file to perform test to see whether cookie work or not

The xhtml file allows you to click on a blue rect to check for cookies. First a message will be displayed giving the document.cookie value (undefined if cookies don't work).
Second, it will try to put something in cookie and then get what it put.
Then, a message will be displayed : the value of the cookie get (null if it don't work, "aValue" else).
Comment 2 Mark Rowe (bdash) 2007-06-18 10:38:23 PDT
This would be due to "cookie" being a property of HTMLDocument as per <http://www.w3.org/TR/DOM-Level-2-HTML/html.html#ID-8747038>.  In an XHTML document, "document" is an instance of Document rather than HTMLDocument so it lacks this property.  I'm not sure that this can be considered a bug so much as a limitation of XHTML.
Comment 3 François Lamboley 2007-06-20 02:44:12 PDT
So it isn't possible to make a cookie using strict xhtml ?
This should be a big regression from html 4 (in fact, firefox has cookie with xhtml, it's possible it is not normative…) !
Comment 4 Alexey Proskuryakov 2007-06-22 04:49:29 PDT
See also: bug 12628.
Comment 5 Alexey Proskuryakov 2007-10-06 02:08:22 PDT
The current HTML5 draft specifies document.cookie for XHTML.

Fixed in revision 26078 (feature branch).