-
Notifications
You must be signed in to change notification settings - Fork 583
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. |
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
This PR introduces support for partitioned cookies in Mojolicious to address upcoming browser changes regarding third‐party cookies.
- Added a new partitioned flag in cookie tests, sessions, and cookie parsing.
- Extended the Mojolicious::Sessions and Mojo::Cookie::Response modules to handle the Partitioned attribute.
Reviewed Changes
Copilot reviewed 3 out of 3 changed files in this pull request and generated 3 comments.
File | Description |
---|---|
t/mojo/cookie.t | Tests updated to validate the new Partitioned cookie behavior |
lib/Mojolicious/Sessions.pm | Sessions module updated to include partitioned cookie support |
lib/Mojo/Cookie/Response.pm | Cookie parsing/stringification enhanced for Partitioned flag |
= Mojo::Cookie::Response->parse( | ||
'foo="bar"; Domain=example.com; Partitioned; Path=/test; Max-Age=60; Expires=Thu, 07 Aug 2008 07:07:59 GMT; Secure;' | ||
); | ||
is $cookies->[0]->partitioned, 1, 'right paritionted value'; |
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.
The test message contains a typo: 'paritionted' should be corrected to 'partitioned'.
is $cookies->[0]->partitioned, 1, 'right paritionted value'; | |
is $cookies->[0]->partitioned, 1, 'right partitioned value'; |
Copilot uses AI. Check for mistakes.
my $bool = $sessions->partitioned; | ||
$sessions = $sessions->partitioned($bool); | ||
|
||
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.
The word 'ammendment' is misspelled; it should be 'amendment'.
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.
=head2 partitioned | ||
|
||
my $partitioned = $cookie->partitioned; | ||
$cookie = $cookie->parititoned(1); |
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.
The method call 'parititoned(1)' appears to be a typo; it should be 'partitioned(1)' to correctly set the flag.
$cookie = $cookie->parititoned(1); | |
$cookie = $cookie->partitioned(1); |
Copilot uses AI. Check for mistakes.
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.
Good bot!
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