Answer the question
In order to leave comments, you need to log in
Symfony3 how to make Remember me work?
Friends, colleagues welcome!
There is a project on Symfony 3.1.4. There are users, there is a standard authorization and verification form.
In app/config/config.yml
session:
handler_id: session.handler.native_file
save_path: ~
cookie_lifetime: 2678400 # месяц
gc_probability: 0
cookie_path: /
security:
encoders:
AppBundle\Entity\User:
id: app.custom_password_encoder
AppBundle\Entity\Project: bcrypt
role_hierarchy:
ROLE_ADMIN: [ROLE_USER]
providers:
our_users:
entity: { class: AppBundle\Entity\User, property: email }
accounts:
entity: { class: AppBundle\Entity\Project, property: email }
firewalls:
api:
host: ^api
anonymous: true
stateless: true
guard:
authenticators:
- 'jwt_token_authenticator'
- 'project_authenticator'
entry_point: jwt_token_authenticator
main:
pattern: /.*
anonymous: ~
guard:
authenticators:
- app.security.login_form_authenticator
form_login:
login_path: security_login
always_use_default_target_path: true
default_target_path: /
provider: our_users
remember_me: true
logout:
path: /logout
remember_me:
secret: '%secret%'
always_remember_me: true
lifetime: 2678400
remember_me_parameter: _remember_me
path: /
domain: ~
access_control:
. . .
Answer the question
In order to leave comments, you need to log in
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question