Closed Bug 126177 Opened 23 years ago Closed 23 years ago

document.cookie doesn't work in files served as application/xhtml+xml

Categories

(Core :: Networking: Cookies, defect)

x86
Windows 98
defect
Not set
normal

Tracking

()

VERIFIED DUPLICATE of bug 111514
mozilla1.0

People

(Reporter: paul, Assigned: morse)

References

()

Details

From Bugzilla Helper:
User-Agent: Mozilla/5.0 (Windows; U; Win98; en-US; rv:0.9.8) Gecko/20020204
BuildID:    2002-02-04-06

When a cookie is attempted to be set using document.cookie the string passed is
simply stored in the variable document.cookie instead of being parsed and added
as a cookie.

The problem also seems to persist when using PHP to set cookies

Reproducible: Always
Steps to Reproduce:
1. Load up the page
2. A cookie "test" is attempted to be made, but the string is smply stored and
no cookie is saved.


Actual Results:  The string passed to document.cookie is stored under that
variable instead of being parsed and saved as a cookie

Expected Results:  a cookie called "test" should be created
Works fine for me.  I downloaded the reporters test file to my hard disk and 
brought it up in the browser.  I got the alert saying "test=foo".  Then I went 
to the cookie-manager dialog and saw the test=foo cookie correctly stored there, 
and with the correct expiration time (24 hours ahead).
Status: UNCONFIRMED → RESOLVED
Closed: 23 years ago
Resolution: --- → WORKSFORME
> I downloaded the reporters test file to my hard disk

The bug is only present when the document is served with content type
application/xhtml+xml and if the document is served as type text/html the
cookies work fine.

The document on my web server is being served as application/xhtml+xml.
If you have a testcase on a webserver, then give the url for that and reopen 
the bug.  The url that you gave is for a file that gets downloaded.
The testcase I gave from my server opened in my Mozilla (0.9.8 on win98).

I have tried saving it as a php file and sending the header "Content-Type:
application/xhtml+xml", so it should open as a file in Mozilla.

The problem is consistently showing up in my version (0.9.8 on win98) and my
dad's (0.9.8 on NT4).
OK, I'm able to reproduce.  Don't know why I had a problem before.

Reopening and confirming.
Status: RESOLVED → UNCONFIRMED
Resolution: WORKSFORME → ---
Status: UNCONFIRMED → ASSIGNED
Ever confirmed: true
Target Milestone: --- → mozilla1.0
Isn't this just another face of the "application/xhtml+xml produces an
XMLDocument, not an HTMLDocument" problem?  Hence there is no document.cookie
property in documents served as application/xhtml+xml
sure that's the problem, and it seems the only bug we have about it is bug 111514

*** This bug has been marked as a duplicate of 111514 ***
Status: ASSIGNED → RESOLVED
Closed: 23 years ago23 years ago
Resolution: --- → DUPLICATE
V/dupe.
Status: RESOLVED → VERIFIED
QA Contact: tever → benc
You need to log in before you can comment on or make changes to this bug.