-
Notifications
You must be signed in to change notification settings - Fork 581
Add support for partitioned cookies #2196
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks like some values are not ordered alphabetically and documentation is missing.
We could also mark this as experimental, though it is implemented in most browsers. |
This pull request is now in conflicts. Could you fix it @rawleyfowler? 🙏 |
This pull request is now in conflicts. Could you fix it @rawleyfowler? 🙏 |
Plack recently merged this into |
Yes, since this is only a draft spec we have to mark it experimental. |
@kraih Thanks for the review, they've been fixed. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Pull Request Overview
Adds support for the new Partitioned
cookie attribute to both core cookie handling and session cookies, and updates tests to cover the new behavior.
- Extend
Mojo::Cookie::Response
parsing, serialization, and docs withpartitioned
- Add
partitioned
flag toMojolicious::Sessions
and include it in Set-Cookie options - Update tests in
t/mojo/cookie.t
to coverPartitioned
output and parsing
Reviewed Changes
Copilot reviewed 3 out of 3 changed files in this pull request and generated 1 comment.
File | Description |
---|---|
t/mojo/cookie.t | Added calls to partitioned(1) and new subtest for parsing |
lib/Mojolicious/Sessions.pm | Introduced partitioned attribute in constructor, store logic, and docs |
lib/Mojo/Cookie/Response.pm | Added partitioned to has , parsing map, to_string , and docs |
Comments suppressed due to low confidence (1)
lib/Mojolicious/Sessions.pm:58
- Consider adding tests to verify that the
partitioned
flag on session cookies results in thePartitioned
attribute being set in theSet-Cookie
header.
partitioned => $self->partitioned,
my $partitioned = $cookie->partitioned; | ||
$cookie = $cookie->partitioned(1); | ||
|
||
Partitioned flag, this is to be used in accordance to the CHIPS ammendment to RFC 6265. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Typo: 'ammendment' should be 'amendment' for accuracy in the documentation.
Partitioned flag, this is to be used in accordance to the CHIPS ammendment to RFC 6265. | |
Partitioned flag, this is to be used in accordance to the CHIPS amendment to RFC 6265. |
Copilot uses AI. Check for mistakes.
Summary
Firefox is soon going to ignore third-party aka "foreign" aka
SameSite: None
Motivation
These changes allow Mojolicious to handle the new "Partitioned" attribute, as well as adding the ability to set
Partitioned
onMojolicious::Sessions
cookies.References
https://www.ietf.org/archive/id/draft-cutler-httpbis-partitioned-cookies-00.html
https://github.com/privacycg/CHIPS
fixes #2179