document.cookie does not contain some (or all) cookies after XHR with HTTP Status 302
Categories
(Core :: Networking: Cookies, defect, P2)
Tracking
()
| Tracking | Status | |
|---|---|---|
| firefox-esr140 | --- | unaffected |
| firefox143 | --- | wontfix |
| firefox144 | --- | fixed |
| firefox145 | --- | fixed |
People
(Reporter: mario, Assigned: edgul)
References
(Regression)
Details
(Keywords: regression, Whiteboard: [necko-triaged] [necko-priority-queue])
Attachments
(1 file, 1 external file)
|
186.59 KB,
image/png
|
Details |
User Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:143.0) Gecko/20100101 Firefox/143.0
Steps to reproduce:
- Open Firefox v143
- In a new tab, navigate to https://cookie-test.eightbitmachine.com
- Open the browser's developer tools.
- On the page, click the "Fetch Cookies with native fetch" button.
- In the console, click the "Storage" tab, then click "Cookies" on the menu. Select "https://cookie-test.eightbitmachine.com/" to view the cookies that have been set.
- Click on the "Console" tab. There will be an array dumped to the console log with a single element containing
"'. This represents the cookies available viadocument.cookie. - You can double check this by evaluating
document.cookieon the console. - Compare with the results of evaluating
cookieStore.getAll().then(console.log) - Click the "Storage" tab in the browser's developer tools
- Right click on "https://cookie-test.eightbitmachine.com/" in the Storage menu and select "Delete all"
- On the page, change the "HTTP Status Code" input value to
200. - On the page, click the "Fetch Cookies with native fetch" button.
- Click on the "Console" tab in the browser's developer tools.
- A list of the cookies that were set should be printed in the console log.
Actual results:
document.cookie does not contain any of the cookies that were set, regardless of SameSite, HttpOnly and Secure attributes when set in a Response with an HTTP Status code 302.
However, it appears to function correctly when the Status Code is 200.
Expected results:
document.cookie should contain at least some of the cookies that were set, based on their attributes.
The cookies are present. This verifiable via the browser development tools and using the cookieStore API.
Comment 1•1 year ago
|
||
The Bugbug bot thinks this bug should belong to the 'Core::Networking: Cookies' component, and is moving the bug to that component. Please correct in case you think the bot is wrong.
Comment 2•1 year ago
|
||
FYI Edgul
The recent addition of MaybeInitializeCookieProcessingGuards prevent the sending of cookies over the primary path to the content process. And cookies also seemed to get lost in the fast path, probably due to the redirect that occurred without copying cookies over to the new HttpChannelParent. This patch allows for the copying of the cookies from old to new HttpChannelParent when we take the fast path.
Updated•1 year ago
|
Updated•1 year ago
|
Comment 4•1 year ago
|
||
Set release status flags based on info from the regressing bug 1977221
Comment 7•1 year ago
|
||
| bugherder | ||
Updated•1 year ago
|
Comment 8•1 year ago
|
||
The patch landed in nightly and beta is affected.
:edgul, is this bug important enough to require an uplift?
- If yes, please nominate the patch for beta approval.
- See https://wiki.mozilla.org/Release_Management/Requesting_an_Uplift for documentation on how to request an uplift.
- If no, please set
status-firefox144towontfix.
For more information, please visit BugBot documentation.
Comment on attachment 9514431 [details]
Bug 1989488 - fix 302 set-cookies not being sent to content process. r?#cookie-reviewers
Beta/Release Uplift Approval Request
- User impact if declined/Reason for urgency: Cookies not being set in XHR/fetch redirect and favicon scenarios. Could impact ability to login.
- Is this code covered by automated tests?: Yes
- Has the fix been verified in Nightly?: No
- Needs manual test from QE?: No
- If yes, steps to reproduce:
- List of other uplifts needed: Bug 1991118
- Risk to taking this patch: Low
- Why is the change risky/not risky? (and alternatives if risky): This patch un-restricts cookie sending between processes. Relaxing the rules shouldn't introduce any bugs.
- String changes made/needed:
- Is Android affected?: Yes
Updated•1 year ago
|
Comment 10•1 year ago
|
||
Comment on attachment 9514431 [details]
Bug 1989488 - fix 302 set-cookies not being sent to content process. r?#cookie-reviewers
Approved for 144.0b8.
Updated•1 year ago
|
Comment 11•1 year ago
|
||
| uplift | ||
Updated•6 months ago
|
Description
•