Uh oh!
There was an error while loading. Please reload this page.
fix: ucfirst all cookie samesite values - #9564
Merged
paulbalandan merged 5 commits intoMay 20, 2025
Merged
Conversation
michalsn
commented
May 17, 2025
Member
Yes, this should go to the 4.7 branch. |
michalsn
commented
May 17, 2025
Member
Oh, we should also adjust the user guide: https://github.com/codeigniter4/CodeIgniter4/blob/develop/user_guide_src/source/libraries/cookies/006.php |
paulbalandan
commented
May 18, 2025
MemberAuthor
Thanks, added |
ddevsr
reviewed
May 19, 2025
Uh oh!
There was an error while loading. Please reload this page.
ddevsr
reviewed
May 19, 2025
Uh oh!
There was an error while loading. Please reload this page.
paulbalandanforce-pushed
the
fix-cookie-samesite-empty-defaults
branch
from
May 19, 2025 10:49
e73a328 to
2cc7775CompareUh oh!
There was an error while loading. Please reload this page.
samsonasik
approved these changes
May 20, 2025
paulbalandan
commented
May 20, 2025
MemberAuthor
Thanks all for the reviews. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for freeto join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Description
If you run
vendor/bin/phpunit --filter CookieTestyou get:This is because when you pass an empty defaults array (or did not pass anything) to
Cookie::setDefaults(), the samesite value set isself::SAMESITE_LAXequal tolax. Now, we transform the samesite value toucfirstin the constructor so that it would be consistent everywhere. Even the cookie config's allowed value for samesite is in ucfirst. I thought we have done that pretty much everywhere but found out this case wasn't. This failure was not caught since the test case is run along with the other tests. Running it by itself shows the issue.I have targeted
4.7since I'm changing the values of the constants so I think this is a behavior change. Let me know if this is ok indevelop.Checklist: