-
-
Notifications
You must be signed in to change notification settings - Fork 9.6k
[SecurityBundle] Stop delete_cookies keys from being normalized #24018
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
[SecurityBundle] Stop delete_cookies keys from being normalized #24018
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.
Related to 8d03332
AppVeyor failure looks unrelated. |
As for #21718 doing this now is a BC break, people might rely on the current behavior and/or workaround it on their side. |
A BC layer could be to add the underscore version of cookie names in the list whenever a dashed one is here, to keep clearing the underscore version too (it would then clear 2 cookies). |
@thewilkybarkid Would you mind looking at @stof's suggestion? I can do it if you don't. |
This is for 3.4 as it is a behavior change and should include deprecations, branch needs to be rebased and PR retargeted. |
Don't see how this is a BC break? I don't think it's possible to rely on the current behaviour (since it's mangling the name), and if you have an existing workaround then that would continue to work? If you want underscores if your cookie name why wouldn't you have used that already? |
Dunno, probably no viable reason. But fact is that if one set a name with dashes and ends up with underscores, one could just forgot about the name set in the config and implicitly rely on this behavior. For the same input the final value will be different than before, that is a behavior change which can break. |
But why prioritise someone who's incorrectly configured the cookie name here (using dashes when they meant underscores) over someone who's being bitten by this bug (probably without realising)? |
@thewilkybarkid That is where I disagree. Incorrectly or not, the one who did configure it could be a different person that the one who rely on the unexpected result, thinking it's expected, letting untouched and just dealing with underscores... Breaking (edge) cases are easy to imagine here. |
I agree with Stof and @chalasr. This is obviously a worthwhile fix - definitely was a bug/mistake originally. But we should add the BC layer. @thewilkybarkid Feature freeze is this weekend? Would you have time to update your PR before then? Thanks! |
Moving to 4.1. Rebase on master might be needed, where PHP 7.1 features can be used btw. |
This is tricky ... but Symfony's policy in similar situations has always been:
So I'd say, this is a bug fix and not a BC break. |
Still -1 for me without BC layer, not worth the breaking change as there is a valid way to avoid this behavior (by specifying |
Still don't agree that it needs a BC layer since it's a bug that doesn't have behaviour that can be relied on. But I'd much rather the bug is fixed than having this left open, so do whatever's needed to have it resolved. |
Closing in favor of #30111, thank you for rising the issue. |
…okie names (javiereguiluz) This PR was squashed before being merged into the 4.3-dev branch (closes #30111). Discussion ---------- [SecurityBundle] Deprecate the normalization of the cookie names | Q | A | ------------- | --- | Branch? | master | Bug fix? | yes | New feature? | yes | BC breaks? | no | Deprecations? | no | Tests pass? | yes | Fixed tickets | - | License | MIT | Doc PR | - This is an alternative solution to #24018 providing a BC layer until Symfony 5.0. Commits ------- 36c5df4 [SecurityBundle] Deprecate the normalization of the cookie names
Currently the cookie names inside
delete_cookies
are normalized, so using YAML a cookie with the name 'foo-bar' becomes 'foo_bar', and so isn't deleted.