8000 [HttpFoundation] Cookies Having Independent Partitioned State (CHIPS) by fabricecw · Pull Request #52002 · symfony/symfony · GitHub
[go: up one dir, main page]

Skip to content

[HttpFoundation] Cookies Having Independent Partitioned State (CHIPS) #52002

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 8000 “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

Merged
merged 1 commit into from
Oct 16, 2023

Conversation

fabricecw
Copy link
Contributor
@fabricecw fabricecw commented Oct 12, 2023
Q A
Branch? 6.4
Bug fix? no
New feature? yes
Deprecations? no
Tickets -
License MIT

Due to Chrome's roadmap (and all other major browsers) to phase out third-party cookies starting from midway through 2024, "partitioned" cookies were introduced. If a cookie is flagged as partitioned, its cross-site boundry is tied to the top-level site.

Considerations: According to current security design, browser will only accept partitioned cookies with the secure flag and SameSite attribute none (otherwise it isn't a third-party cookie...). I classified this as an implementation topic and therefore omitted this validation in the Cookie class itself.

Further information:

@carsonbot
Copy link

Hey!

I see that this is your first PR. That is great! Welcome!

Symfony has a contribution guide which I suggest you to read.

In short:

  • Always add tests
  • Keep backward compatibility (see https://symfony.com/bc).
  • Bug fixes must be submitted against the lowest maintained branch where they apply (see https://symfony.com/releases)
  • Features and deprecations must be submitted against the 6.4 branch.

Review the GitHub status checks of your pull request and try to solve the reported issues. If some tests are failing, try to see if they are failing because of this change.

When two Symfony core team members approve this change, it will be merged and you will become an official Symfony contributor!
If this PR is merged in a lower version branch, it will be merged up to all maintained branches within a few days.

I am going to sit back now and wait for the reviews.

Cheers!

Carsonbot

@OskarStark
Copy link
Contributor

Please rebase your branch. We cannot merge PRs containing merge commits. Thanks

@fabricecw
Copy link
Contributor Author

Please rebase your branch. We cannot merge PRs containing merge commits. Thanks

Thanks @OskarStark, that was unintentional. Cleaned up.

@Nyholm
Copy link
Member
Nyholm commented Oct 12, 2023

Lovely. Thank you for this PR. What a great first contribution!

I agree with all your changes, but I am a bit hesitant on adding types to protected properties (which is not mentioned in our BC policy). If you want this PR to get a quick merge, I suggest you remove all unrelated changes. Example: Changing the existing properties and doing assertSame() on existing tests.

Doing this will make sure the discussions are only focus on the partitioned cookie feature.

Also, can you please have a look on the fabbot.io CI job?

@fabricecw
Copy link
Contributor Author
fabricecw commented Oct 12, 2023

I agree. Apart from a very low likelyhood of a BC, typed attributes can wait until a major release. I further reverted the assertSame change as suggested by @OskarStark even I like the stricter assertions.

All HttpFoundation tests are passing.

@fabricecw
Copy link
Contributor Author

Status: Needs Review

@nicolas-grekas nicolas-grekas added the ❄️ Feature Freeze Important Pull Requests to finish before the next Symfony "feature freeze" label Oct 14, 2023
@nicolas-grekas nicolas-grekas force-pushed the 6.4 branch 2 times, most recently from 6033e39 to 9d1d441 Compare October 16, 2023 09:02
Copy link
Member
@nicolas-grekas nicolas-grekas left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM thanks. I think this feature is important to have for 6.4!

I pushed some minor changes, see https://github.com/symfony/symfony/compare/9e0b944c1f6a0ceeb005eba148c7e5aba19c257f..9d1d4415914b7d4412c93d41ebae0f2db3c1b221

@fabricecw
Copy link
Contributor Author
fabricecw commented Oct 16, 2023

Thanks @nicolas-grekas! That forward compatibility modification is great.

As you said, it makes sense (if possible) to ship it with 6.4 so we don't fall behind the current pace of major browsers.

@fabpot
Copy link
Member
fabpot commented Oct 16, 2023

Thank you @fabricecw.

@fabpot fabpot merged commit f13a4b1 into symfony:6.4 Oct 16, 2023
This was referenced Oct 21, 2023
nicolas-grekas added a commit that referenced this pull request Feb 1, 2024
This PR was squashed before being merged into the 6.4 branch.

Discussion
----------

[HttpFoundation] Fix clearing CHIPS cookies

| Q             | A
| ------------- | ---
| Branch?       | 6.4
| Bug fix?      | yes
| New feature?  | no
| Deprecations? | no
| Issues        | N/A
| License       | MIT

Related PR:
- #52002

This PR is the continuation of #52002 to add the `partitioned` parameter when we want to clear a cookie with this parameter.

Besides, this PR adds this parameter for deleted cookies on logout.

Commits
-------

bfe2670 [HttpFoundation] Fix clearing CHIPS cookies
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Feature HttpFoundation ❄️ Feature Freeze Important Pull Requests to finish before the next Symfony "feature freeze" Status: Reviewed
Projects
None yet
Development

Successfully merging this pull request may close these issues.

8 participants
31AF
0