我为这样的登录用户提供了一个安全区域-->
firewalls:
members_secured_area:
pattern: ^/
provider: entity_searchers
anonymous: ~
form_login:
check_path: /searchers/login_check
login_path: /searchers/login
default_target_path: /searchers/
logout:
path: /searchers/logout
target: /searchers/login
crm_secured_area:
pattern: ^/crm/
provider: entity_crmusers
anonymous: ~
form_login:
check_path: /crm/login_check
login_path: /crm/login
default_target_path: /crm/customers
logout:
path: /crm/logout
target: /crm/login
remember_me:
#token_provider: entity_crmusers
key: someS3cretKey
name: NameOfTheCookie
lifetime: 3600 # in seconds
secure: false
httponly: true
always_remember_me: false
remember_me_parameter: _remember_me
access_control:
members_login:
path: /searchers/login
roles: IS_AUTHENTICATED_ANONYMOUSLY
members_register:
path: /searchers/register
roles: IS_AUTHENTICATED_ANONYMOUSLY
members_area:
path: /searchers/.*
roles: ROLE_USER
crm_login:
path: /crm/login
roles: IS_AUTHENTICATED_ANONYMOUSLY
crm_register:
path: /crm/register
roles: IS_AUTHENTICATED_ANONYMOUSLY
crm_area:
path: /crm/.*
roles: ROLE_CRM
因此,当用户在安全区域时,我可以看到他已登录,但是当他返回主页或 mysite.com/about 页面时,我不知道他是否已登录...
有办法知道吗?