title: Logout does not destroy/clear session properly in FOSUserBundle
body: <p>I'm having some problems, don't know why, when I logout from my application which is handled by FOSUserBundle since current session is never destroyed or even clear which is causing issues when I login back cause I store some data on session. This is how my <code>security.yml</code> looks like:</p>
  
  <pre><code>security:
      encoders:
          FOS\UserBundle\Model\UserInterface: sha512
  
      role_hierarchy:
          ROLE_USER: ROLE_USER
          ROLE_ADMIN: ROLE_ADMIN
  
      providers:
          fos_userbundle:
              id: fos_user.user_provider.username_email
  
      firewalls:
          dev:
              pattern: ^/(_(profiler|wdt)|css|images|js)/
              security: false
          main:
              pattern: ^/
              form_login:
                  provider: fos_userbundle
                  csrf_provider: form.csrf_provider
                  login_path:  /login
                  check_path:  /login_check
                  default_target_path: home
                  always_use_default_target_path: true
              logout:
                   path: fos_user_security_logout
                   target: /
                   invalidate_session: false
              anonymous: ~
  
      access_control:
          ...    
  </code></pre>
  
  <p>And this is how the <code>session</code> keys are configured at <code>config.yml</code>:</p>
  
  <pre><code>session:
      # handler_id set to null will use default session handler from php.ini
      handler_id:  ~
      cookie_lifetime: 86400
      gc_maxlifetime: 600 # session will expire after 10 minutes of inactivity
      gc_probability: 1
      gc_divisor: 1
  </code></pre>
  
  <p>I'm missing something else here?</p>
  
  <p>As a second part of this question I have a big doubt since this is something new to me and it's related to how garbage collection works in Symfony2? I was reading <a href="http://symfony.com/doc/current/components/http_foundation/session_configuration.html#configuring-garbage-collection" rel="nofollow noreferrer">docs</a> around it but is not clear to me and also I don't know if this is the cause because session isn't destroyed properly when I logout from the application. Any explanation around this? If I'm not mistaken my application will logout users, automatically, when 10 min pass without do nothing, meaning <strong>inactivity</strong>, I'm right? But how or what the GC part do on this config? I take that configuration from <a href="https://stackoverflow.com/a/21285238/719427">this</a> topic but not understand that one yet.</p>
  
  <p>As an additional note, I'm working with Firefox|Chrome both in private windows so no cache from browser should exists.</p>