You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Chrome is phasing out support for Third Party Cookies in Q1 2024, and for several key use cases, the proposed solution is CHIPS (https://github.com/privacycg/CHIPS).
Currently, cookies with the Partitioned attribute cannot be set from within the http.cookies library. I'm proposing that we add support for that attribute.
Has this already been discussed elsewhere?
This is a minor feature, which does not need previous discussion elsewhere
Hey there @AlexWaygood, just a ping on this issue per the contributors guide -- this issue and the PR have been up for about six weeks now. A review would be appreciated, thank you!
AFAIU this is a proposed / experimental thing for now, and from MDN it’s not implemented in Firefox or Safari yet.
If this becomes a standard (with WHATWG or W3C), it could be considered for Python.
Sorry I missed your comment earlier. Holding off awaiting a standard is fine, I misread it and thought it'd been implemented already rather than seeing those were the prior attempts.
This really just seems to be adding an attribute that adds an additional string to a cookie. If it winds up not meaning anything, it wouldn't be the end of the world - though we'd obviously need different docs than what the PR contains right now.
What's the alternative within the existing http.cookies API for adding Partitioned to a cookie it creates and checking for Partitioned when parsing today without implementing your own parsing? (that could expand into a bigger question about whether the stdlib API is actually a good one)
I think it's because the feature may or may not be included in that version when it's being merged. (Actually, I'm only following the devguide: https://devguide.python.org/triage/labels/#type-labels). We however use the 3.x labels for indicating the versions being affected by bugs (and those labels are then mirrored on the PR with "need backport 3.x")
FYI, current behavior is to just silently drop cookie data when encountering any unsupported field such as partitioned, which leads to downstream weirdness that's difficult to troubleshoot. In my case it's expecting response cookies to be stored in an aiohttp session and some of them just not getting stored with zero errors. I would have expected an exception to be raised on invalid input.
python -i
Python 3.13.0 experimental free-threading build (main, Oct 16 2024, 03:26:14) [Clang 18.1.8 ] on linux
Type "help", "copyright", "credits" or "license"for more information.
>>> from http.cookies import SimpleCookie
>>> c=SimpleCookie()
>>> c.load('TOKEN=foo; path=/; expires=Fri, 06 Dec 2024 18:10:39 GMT; samesite=none; secure; httponly; partitioned;')
>>> c
<SimpleCookie: >
>>> c.load('TOKEN=foo; path=/; expires=Fri, 06 Dec 2024 18:10:39 GMT; samesite=none; secure; httponly;')
>>> c
<SimpleCookie: TOKEN='foo'>
Activity
giles-v commentedon Jan 17, 2024
Hey there @AlexWaygood, just a ping on this issue per the contributors guide -- this issue and the PR have been up for about six weeks now. A review would be appreciated, thank you!
Flecart commentedon Feb 10, 2024
I need this feature, for starlette. Kludex/starlette#2500.
test: add partitioned attribute
merwok commentedon Feb 12, 2024
AFAIU this is a proposed / experimental thing for now, and from MDN it’s not implemented in Firefox or Safari yet.
If this becomes a standard (with WHATWG or W3C), it could be considered for Python.
merwok commentedon Feb 14, 2024
@gpshead could you reply to my note here before going on with the PR?
gpshead commentedon Feb 14, 2024
Sorry I missed your comment earlier. Holding off awaiting a standard is fine, I misread it and thought it'd been implemented already rather than seeing those were the prior attempts.
This really just seems to be adding an attribute that adds an additional string to a cookie. If it winds up not meaning anything, it wouldn't be the end of the world - though we'd obviously need different docs than what the PR contains right now.
What's the alternative within the existing
http.cookiesAPI for adding Partitioned to a cookie it creates and checking for Partitioned when parsing today without implementing your own parsing? (that could expand into a bigger question about whether the stdlib API is actually a good one)4 remaining items
merwok commentedon Feb 21, 2024
OK, there seems to be consensus, so this can be added to 3.13
fix: Fixes new cookie flag preventing auth cookie from being stored
picnixz commentedon Sep 9, 2024
FTR: issues with
type-featurealways target the latest branch.merwok commentedon Sep 9, 2024
ok but why remove the tag indicating the version that a feature will or does appear in?
picnixz commentedon Sep 9, 2024
I think it's because the feature may or may not be included in that version when it's being merged. (Actually, I'm only following the devguide: https://devguide.python.org/triage/labels/#type-labels). We however use the 3.x labels for indicating the versions being affected by bugs (and those labels are then mirrored on the PR with "need backport 3.x")
jinnatar commentedon Dec 6, 2024
FYI, current behavior is to just silently drop cookie data when encountering any unsupported field such as
partitioned, which leads to downstream weirdness that's difficult to troubleshoot. In my case it's expecting response cookies to be stored in an aiohttp session and some of them just not getting stored with zero errors. I would have expected an exception to be raised on invalid input.giles-v commentedon Jan 22, 2025
@merwok @gpshead just wanted to bump #112714 (comment) -- I think the PR to resolve this remains ready for review.
gpshead commentedon Jan 24, 2025
Thanks for your work and patience. the PR is approved and set to automerge!
gh-112713 : Add support for 'partitioned' attribute in http.cookies (G…
test: add partitioned attribute