title: Symfony 2 : Security Configuration : Login and logout handlers
body: <p>Using Symfony 2, I am looking for more information about the handlers that you can define in the security configuration file <code>app/config/security.yml</code> (<a href="http://symfony.com/doc/current/reference/configuration/security.html" rel="nofollow noreferrer">official documentation</a>). The documentation doesn't give any informations about handlers. Here is an extract of the security file :</p>
  <pre><code># app/config/security.yml
  
  security:        
      ...
  
      firewalls:                            
              somename:
          
                  form_login:
                      ...
      
                      # login failure redirecting options (read further below)
                      failure_path:    /foo
                      failure_forward: false
                      failure_path_parameter: _failure_path
                      failure_handler: some.service.id
                      success_handler: some.service.id
      
      
                  logout:
                      path:   /logout
                      target: /
                      invalidate_session: false
                      delete_cookies:
                          a: { path: null, domain: null }
                          b: { path: null, domain: null }
                      handlers: [some.service.id, another.service.id]
                      success_handler: some.service.id
                  anonymous: ~
  </code></pre>
  <p>In both <em>form_login</em> ang <em>logout</em> part there is a <code>success_handler</code> field. Moreover, for <em>logout</em> part you can define several handlers using <code>handlers</code> field.</p>
  <p>I have two questions :</p>
  <ol>
  <li><p>If I define a <code>succes_handler</code> service (using for example AuthenticationSuccessHandlerInterface or LogoutHandlerInterface), will it overide the default success handler provided in the framework ?</p>
  </li>
  <li><p>For the <em>logout</em> part of the configuration, how work the <code>handlers</code>field ?</p>
  </li>
  </ol>