title: Symfony2 authenticated users are redirected to login page on Access Denied exception
body: <p>When the user is not authenticated, on Access Denied it is redirected to login page, this is fine.</p>
  
  <p>But when it is authenticated, it should stay on Access Denied page and display the error message, but it is redirected to login page, then that page throws Access Denied exception (because only not authenticated users can access the login page) and that creates an infinite redirect loop.</p>
  
  <pre><code>providers:
      app_user:
          entity:
              class: AppUserBundle:User
              property: username
  
  firewalls:
      main:
          pattern: ^/
          form_login:
              #check_path: route_id
              login_path: app_user_login
          provider: app_user
          #logout:
          #    path:   route_id
          #    target: route_id
          anonymous: ~
  </code></pre>
  
  <p>I have commented <code># check_path:</code> because I use custom register/login pages and my login form is submitted to <code>login_path:</code>. That worked well until I moved my provider to <code>entity</code>. Before that I had a custom provider that loaded users from Cassandra database.</p>
  
  <p>I found the problem: My site is using remember_me authentications, but in Symfony there is <a href="https://github.com/symfony/symfony/blob/58efb98c6fa6d3d4f63cbaf31a6ca86e23782b2f/src/Symfony/Component/Security/Http/Firewall/ExceptionListener.php#L120" rel="nofollow">this line</a> that is executed on AccessDenied exception. When I changed <code>-&gt;isFullFledged($token)</code> to <code>-&gt;isRememberMe($token)</code> everything works fine. Do you think this is <a href="https://github.com/symfony/symfony/issues/15370" rel="nofollow">a Symfony bug</a>?</p>