I have managed to get the login working in Symfony2, but I have trouble with /logout. I get an exception saying it can't find the controller for the route. However, I was under the impression that Symfony deals with the logout process, just like it deals with the login?
(part of) my security.yml file:
firewalls:
login_firewall:
pattern: ^/login/
anonymous: ~
secured_area:
pattern: ^/(dashboard|directories|login_check)/
anonymous: ~
form_login:
login_path: /login/
check_path: /login_check/
logout:
path: /logout/
target: /
My (relevant) routes:
_login:
pattern: /login/
defaults: { _controller: NanoBundle:Login:index }
_login_check:
pattern: /login_check/
_logout:
pattern: /logout/
--edit: logout button code:
<a href="{{path('_logout')}}">Logout</a>