This is the how to for redirection implementation by roles after login or logout in Symfony2
- Copy
AfterLoginRedirection.phpandAfterLogoutRedirection.phpto your bundle under the "Redirection" directory - Edit your
services.ymlfile in your bundle and copy/paste the content ofservices.yml - Edit your
security.ymlfile... - ... add
success_handler: redirect.after.logininform_login:section - ... add
success_handler: redirect.after.logoutinlogout:section