Closed
Bug 1224579
Opened 6 years ago
Closed 5 years ago
Setting cookie with leading dot in domain doesn't work
Categories
(WebExtensions :: Untriaged, defect)
Tracking
(firefox46 fixed)
RESOLVED
FIXED
mozilla46
Tracking | Status | |
---|---|---|
firefox46 | --- | fixed |
People
(Reporter: jan, Assigned: kmag)
References
Details
Attachments
(2 files)
2.16 KB,
patch
|
billm
:
review+
|
Details | Diff | Splinter Review |
7.02 KB,
patch
|
evilpie
:
review+
|
Details | Diff | Splinter Review |
Setting cookie with domain which has the leading dot doesn't work. var domain = ".example.com"; chrome.cookies.set({"url": url, "domain": domain, "path": "/", "name": "api_debug", "value": "1"}); It will be probably caused by readding antoher in https://dxr.mozilla.org/mozilla-central/rev/0c648a1efbe06b5ec866ba058d18256b80808b46/toolkit/components/extensions/ext-cookies.js#180 (sorry, the link currently does not work, e500, the general https://dxr.mozilla.org/mozilla-central/source/toolkit/components/extensions/ext-cookies.js#180)
Assignee | ||
Updated•6 years ago
|
Status: UNCONFIRMED → NEW
Ever confirmed: true
Flags: blocking-webextensions?
Comment 1•5 years ago
|
||
When I read the documentation I somehow assumed that all domains should be the opposite host-only, but it only says when "domain" is committed that cookie should become host only. "The domain of the cookie. If omitted, the cookie becomes a host-only cookie." So I have to test Chrome again if it always adds a "." before domains. The two leading dots are definitely wrong.
Assignee: nobody → evilpies
Comment 3•5 years ago
|
||
Attachment #8700613 -
Flags: review?(wmccloskey)
Does the patch in bug 1210996 fix this?
Assignee | ||
Comment 5•5 years ago
|
||
(In reply to Bill McCloskey (:billm) from comment #4) > Does the patch in bug 1210996 fix this? I think it does, but it would be good to have the additional test either way.
Comment on attachment 8700613 [details] [diff] [review] Allow leading dot in domain in cookies.set Review of attachment 8700613 [details] [diff] [review]: ----------------------------------------------------------------- Yeah, that's true. Tom, once Kris lands his patch, can you check that the test passes without your ext-cookies.js change and then just land the test?
Attachment #8700613 -
Flags: review?(wmccloskey) → review+
Comment 7•5 years ago
|
||
The error went away, but the result is wrong. It seems to create a hostOnly cookie now. If 'domain' is specified the result is never a hostOnly cookie. As far as I can tell you can only get such a cookie when omitting it.
Assignee | ||
Comment 8•5 years ago
|
||
You're right, I got that bit of logic wrong.
Attachment #8701501 -
Flags: review?(evilpies)
Assignee | ||
Updated•5 years ago
|
Assignee: evilpies → kmaglione+bmo
Status: NEW → ASSIGNED
Comment 9•5 years ago
|
||
Comment on attachment 8701501 [details] [diff] [review] [webext] Fix the handling of domain cookies Review of attachment 8701501 [details] [diff] [review]: ----------------------------------------------------------------- As requested, we should also land my test. The new code is really nice btw :) ::: toolkit/components/extensions/ext-cookies.js @@ +70,5 @@ > if (!extension.whiteListedHosts.matchesIgnoringPath(uri)) { > return false; > } > > + if (!cookie.host) { Comment that this will be a host only cookie.
Attachment #8701501 -
Flags: review?(evilpies) → review+
Assignee | ||
Comment 10•5 years ago
|
||
https://hg.mozilla.org/integration/fx-team/rev/8338cdb566e28bd2dcaf7ef726cdd49529ae431d Bug 1224579: [webext] Fix the handling of domain cookies. r=evilpie
Assignee | ||
Updated•5 years ago
|
Keywords: leave-open
Assignee | ||
Comment 11•5 years ago
|
||
I fixed the conflicts, and checked that your tests pass after that patch. Let me know if you want me to check it in.
Comment 12•5 years ago
|
||
Sure, whenever you want.
Comment 13•5 years ago
|
||
bugherder |
https://hg.mozilla.org/mozilla-central/rev/8338cdb566e2
Assignee | ||
Updated•5 years ago
|
Keywords: leave-open
Assignee | ||
Comment 14•5 years ago
|
||
https://hg.mozilla.org/integration/fx-team/rev/e25c5bf2da7411a58e2a6e5cb37bf67be23052ff Bug 1224579 - Allow leading dot in domain in cookies.set. r=billm
Comment 15•5 years ago
|
||
bugherder |
https://hg.mozilla.org/mozilla-central/rev/e25c5bf2da74
Status: ASSIGNED → RESOLVED
Closed: 5 years ago
status-firefox46:
--- → fixed
Resolution: --- → FIXED
Target Milestone: --- → mozilla46
Updated•3 years ago
|
Product: Toolkit → WebExtensions
You need to log in
before you can comment on or make changes to this bug.
Description
•