Description
Symfony version(s) affected: 5.0.0
Description
When defining:
firewalls:
main:
anonymous: lazy
The remember me functionality does not work. To be precise: https://github.com/symfony/security-guard/blob/5.0/Firewall/GuardAuthenticationListener.php#L167 is never executed.
How to reproduce
Follow the Security documentation at https://symfony.com/doc/4.4/security.html to set up a basic login form with authentication, except configure anonymous: lazy
. Then follow https://symfony.com/doc/4.4/security/remember_me.html and try to log in with the remember me checkbox ticked. You will see that the REMEMBERME
cookie is not set.
Then change the security configuration to anonymous: true
, clear cache and try logging in again. This time you will get the REMEMBERME
cookie.
Additional context
- Not my post, but this StackOverflow user is running into the same: https://stackoverflow.com/questions/59086076/symfony-4-remember-me-cookie-not-set/59086599#59086599
- It might be related to Symfony authenticator's no longer called with anonymous: lazy #34614 , but I am not sure.