Redirect after login in Symfony 2 Redirect after login in Symfony 2 symfony symfony

Redirect after login in Symfony 2


Yes. You can use the target_path option. Using your example above:

firewalls:    secured_area:        form_login:            always_use_default_target_path: true            default_target_path: /loggedinpage

With the above the user will always be redirected to /loggedinpage upon a successful login. Details of all the options for the security component are available in the Symfony docs (albeit slightly hidden away!)