Answer the question
In order to leave comments, you need to log in
Remember Me not working correctly?
What could be the problem? The Remember me function is enabled, when the user logs in, two REMEMBERME and PHPSESSID cookies are created, everything is fine, but when the PHPSESSID cookie is deleted or after it expires, a new one is created and the user is immediately thrown to the authorization page, and he cannot go anywhere else, although he writes, that the user is authorized.
security.xml
main:
remember_me:
secret: '%kernel.secret%'
lifetime: 604800
path: /
#always_remember_me: true
....
....
access_control:
- { path: ^/login$, role: IS_AUTHENTICATED_ANONYMOUSLY }
- { path: ^/register, role: ROLE_ADMIN }
- { path: ^/system/*, role: ROLE_ADMIN }
- { path: ^/*, role: IS_AUTHENTICATED_FULLY }
Answer the question
In order to leave comments, you need to log in
IS_AUTHENTICATED_FULLY
should be replaced with IS_AUTHENTICATED_REMEMBERED
Here is the documentation
access_control:
- { path: ^/login$, role: IS_AUTHENTICATED_ANONYMOUSLY }
- { path: ^/register, role: ROLE_ADMIN }
- { path: ^/system/*, role: ROLE_ADMIN }
- { path: ^/*, role: IS_AUTHENTICATED_REMEMBERED }
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question