support document.cookie for all documents

RESOLVED FIXED in Firefox 68

Status

()

enhancement
P4
normal
RESOLVED FIXED
17 years ago
20 days ago

People

(Reporter: ashshbhatt, Assigned: Ehsan)

Tracking

(Blocks 1 bug, 4 keywords)

Trunk
mozilla1.9alpha1
x86
Windows NT
Points:
---
Dependency tree / graph

Firefox Tracking Flags

(firefox68 fixed)

Details

()

Attachments

(1 attachment)

Reporter

Description

17 years ago
document.cookie does not write the cookie when called from a xul page, It is
only available until the page is loaded. Press shift+ reload and the cookie is
not there any more. Also if you see the cookie manager while the page is loaded
and the cookie set it dosen't show the cookie.

Comment 1

17 years ago
Yes, there is no implementation of 'cookies' for xul content over http. Is
there a specific reason why this is (or will be) required?

Note that setting |document.cookie| in a xul document is just like setting 
|document.anypropertyname|. i.e., it is just a property of the document, and
not a "magic" property that digests and stores the cookie. For example, if 
you say document.cookie="foo=bar; expires=Thursday, 16-May-2002 23:00:00 GMT";
in an HTML document and then do 'alert(document.cookie);' the value returned is
just the name-value pair "foo=bar". In a xul document, the original string,
including expiration time, is returned
Status: UNCONFIRMED → NEW
Ever confirmed: true

Comment 2

17 years ago
If you really want this, then you should mark it as a request-for-enhancement.
> Is there a specific reason why this is (or will be) required?

For the same reason why you want this in HTML.

Comment 4

14 years ago
I'm currently implementing a xul frontend for sitebar (http://sitebar.org) and
stumbeled over this bug. 
For example does sitebar save the state of open nodes and the session in a
cookie which a can't access from the xul frontend, cause its unprivileged as it
was intended to be. I think its importent that xul should not have lesser
capabilities to access data then html does, otherwise it will not be used.

Updated

14 years ago
Assignee: hyatt → general
Component: XP Toolkit/Widgets: XUL → DOM: Level 0
Priority: -- → P4
QA Contact: shrir → ian
Target Milestone: --- → mozilla1.9alpha

Updated

14 years ago
Assignee: general → benjamin

Comment 5

13 years ago
I ran into this bug as well.  My JavaScript code was not working and I just could not understand why document.cookie was not returning anything.  I am really surprised that document.cookie is not supposed to work with XUL content.  Most programmer will probably find this behavior surprising and inconvenient too. 

Given that XUL is an alternative for writing rich web based applications, this is a major omission.

For now I guess I can embed a small iframe with HTML in it, but that is an ugly solution.
Created http://developer.mozilla.org/en/docs/Remote_XUL to list these kinds of problems.

Updated

12 years ago
Assignee: benjamin → nobody
QA Contact: ian → general
An alternative to cookies is to use globalStorage (Firefox 2.0 and later). Given that I don't expect anyone to put in the work to make cookies functional.
Severity: normal → enhancement
Summary: document.cookie does not write the cookie from a xul page → support document.cookie from xul pages
Assignee

Comment 8

5 months ago

This wpt test is testing whether document.cookie is present on XML documents and is ignored there.

Summary: support document.cookie from xul pages → support document.cookie from all documents
Assignee

Updated

5 months ago
Summary: support document.cookie from all documents → support document.cookie for all documents
Assignee

Comment 9

5 months ago

(In reply to :Ehsan Akhgari from comment #8)

This wpt test is testing whether document.cookie is present on XML documents and is ignored there.

https://searchfox.org/mozilla-central/source/testing/web-platform/meta/xhr/responsexml-document-properties.htm.ini

Assignee

Updated

2 months ago
Assignee: nobody → ehsan

On MDN, we state that all browsers have it already available at Document.cookie; we should probably clarify this.

Keywords: dev-doc-needed

Comment 12

2 months ago
Pushed by eakhgari@mozilla.com:
https://hg.mozilla.org/integration/autoland/rev/ee03e8a4f6cd
Move HTMLDocument.cookie getter/setter to Document; r=bzbarsky

Comment 13

2 months ago
bugherder
Status: NEW → RESOLVED
Closed: 2 months ago
Resolution: --- → FIXED
Assignee

Updated

20 days ago
Keywords: site-compat
You need to log in before you can comment on or make changes to this bug.