You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Description
Manually setting remember_me cookie secure as auto is still is being set as secure one even if used over http.
Problem is that value 'auto' is being set on \Symfony\Component\Security\Http\RememberMe\TokenBasedRememberMeServices service instead of converting to null (to get data from $request->isSecure() method).
That causes a call to onLoginSuccess with secure being set as auto (string) and being treated as true in Cookie __constructor (which has typed bool conversion).
On the other hand - configuration specifies that 'auto' value should be fine.
fliespl
changed the title
[Security] Secure not not working as expected with "auto" setting
[Security] Remember me secure option not working as expected with "auto" setting
Mar 15, 2021
fliespl
added a commit
to fliespl/symfony
that referenced
this issue
Mar 21, 2021
…ookie security (fliespl)
This PR was merged into the 4.4 branch.
Discussion
----------
[Security] Handle properly 'auto' option for remember me cookie security
| Q | A
| ------------- | ---
| Branch? | 4.4
| Bug fix? | yes
| New feature? | no
| Deprecations? | no
| Tickets | Fix#40471
| License | MIT
| Doc PR | n/a
Manually setting remember_me cookie secure as auto is still is being set as secure one even if used over http.
This PR fixes this behaviour by converting auto to null prior setting it up for service.
Commits
-------
2bcf69c [Security] Handle properly 'auto' option for remember me cookie security
Symfony version(s) affected: 4.4 / 5.2
Description
Manually setting remember_me cookie
secure
as auto is still is being set as secure one even if used over http.Problem is that value 'auto' is being set on
\Symfony\Component\Security\Http\RememberMe\TokenBasedRememberMeServices
service instead of converting to null (to get data from $request->isSecure() method).That causes a call to onLoginSuccess with
secure
being set asauto
(string) and being treated as true in Cookie __constructor (which has typed bool conversion).On the other hand - configuration specifies that 'auto' value should be fine.
$builder->enumNode($name)->values([true, false, 'auto'])->defaultValue('auto' === $value ? null : $value);
The text was updated successfully, but these errors were encountered: