title: Symfony2: Create a logout link
body: <p>I am managing users in my symfony2 project. I am able to login and logout without problems. Now, I would like to create a logout link (instead of typing app_dev.php/logout).</p>
  
  <p>I have tryed </p>
  
  <pre><code>&lt;a href="/logout"&gt;Logout&lt;/a&gt;
  </code></pre>
  
  <p>But this link is deleting the app_dev.php and i have only /logout which does not exist.</p>
  
  <p>here is my security.yml</p>
  
  <pre><code>security:
    encoders:
      MDPI\BackendBundle\Entity\Users:
        id: mdpi.backend.backendencoder.class
  
    providers:
      secured_area:
       entity: { class: MDPI\BackendBundle\Entity\Users, property: email }
  
    firewalls:
      secured_area:
        pattern:    ^/
        anonymous: ~
        form_login:
          login_path:  /login
          check_path:  /login_check
        logout:
           path:   /logout
           target: /
  
  
    access_control:
      - { path: ^/(?!login)(.*), role: ROLE_admins }
      - { path: /login.*, role: IS_AUTHENTICATED_ANONYMOUSLY }
  </code></pre>
  
  <p>Thank you very much.</p>