我对symfony2的问题是记住我只与管理员用户合作,否则没有设置cookie。
当我在安全控制器中调用get('security.context') - > isGranted('IS_AUTHENTICATED_REMEMBERED'))时,它返回false
main:
remember_me:
key: "%secret%"
lifetime: 31536000
path: /
domain: ~
pattern: ^/
form_login:
remember_me: true
provider: fos_userbundle
csrf_provider: form.csrf_provider
default_target_path: /
failure_path: /
login_path: /
logout:
target: /
anonymous: true
答案 0 :(得分:0)
防火墙:
main:
remember_me:
key: "%secret%"
lifetime: 31536000 # 365 days in seconds
path: /
domain: ~ # Defaults to the current domain from $_SERVER
always_remember_me: true
secured_area:
pattern: ^/
anonymous: ~
form_login:
login_path: login
check_path: login_check
remember_me: true
logout:
path: /logout
target: /