title: Spring Security RememberMeAuthenticationFilter not fired
body: <p>Im trying to integrate RememberMe functionality inside a Spring 3 webapp.
  The app is working good and doesn't show any other problem.</p>
  
  <p>When I enable the "remember me" check, the cookie is correctly created and sent with any request (i've tested it with Firebug and Chrome DevExtensions).</p>
  
  <p>When I close and reopen the browser, the Cookie is still alive and sent, but the RememberMe Filter is not fired, then the next filter in chain is AnonymousFilter, the user is authenticated as anonymous and sent back to the login page.</p>
  
  <p>Any idea why?</p>
  
  <p>The applicationContext relevant part is:</p>
  
  <pre><code>&lt;security:http&gt;
      &lt;security:intercept-url pattern="/" access="IS_AUTHENTICATED_ANONYMOUSLY" /&gt;
      &lt;security:intercept-url pattern="/login.jsp*" access="IS_AUTHENTICATED_ANONYMOUSLY" /&gt;
      &lt;security:intercept-url pattern="/stylesheets/**" access="IS_AUTHENTICATED_ANONYMOUSLY" /&gt;
      &lt;security:intercept-url pattern="/javascripts/**" access="IS_AUTHENTICATED_ANONYMOUSLY" /&gt;
      &lt;security:intercept-url pattern="/images/**" access="IS_AUTHENTICATED_ANONYMOUSLY" /&gt;
      &lt;security:intercept-url pattern="/impianti/public/**" access="IS_AUTHENTICATED_ANONYMOUSLY" /&gt;
      &lt;security:intercept-url pattern="/buoni/public/**" access="IS_AUTHENTICATED_ANONYMOUSLY" /&gt;
      &lt;security:intercept-url pattern="/admin/*" access="ROLE_ADMIN" /&gt;
      &lt;security:intercept-url pattern="/**" access="ROLE_USER" /&gt;
      &lt;security:form-login login-page="/login.jsp" authentication-failure-url="/login.jsp" default-target-url="/index.html" /&gt;
      &lt;security:http-basic /&gt;
      &lt;security:logout logout-success-url="/login_redirect.jsp" logout-url="/logout" /&gt;
      &lt;security:remember-me/&gt;
  &lt;/security:http&gt;
  
  &lt;security:authentication-manager&gt;
      &lt;security:authentication-provider&gt;
          &lt;security:password-encoder hash="md5" /&gt;
          &lt;security:jdbc-user-service data-source-ref="dataSource"/&gt;
      &lt;/security:authentication-provider&gt;
  &lt;/security:authentication-manager&gt;
  </code></pre>
  
  <p>The logs are:</p>
  
  <p>Before the browser close &amp; reopen:</p>
  
  <pre><code>DEBUG: org.springframework.security.web.FilterChainProxy - /index.html at position 7 of 11 in additional filter chain; firing Filter: 'org.springframework.security.web.authentication.rememberme.RememberMeAuthenticationFilter@1420fea'
  DEBUG: org.springframework.security.web.authentication.rememberme.RememberMeAuthenticationFilter - SecurityContextHolder not populated with remember-me token, as it already contained: (etc)
  </code></pre>
  
  <p>After the reopen:</p>
  
  <pre><code>DEBUG: org.springframework.security.web.FilterChainProxy - /login.jsp at position 7 of 11 in additional filter chain; firing Filter: 'org.springframework.security.web.authentication.rememberme.RememberMeAuthenticationFilter@1420fea'
  DEBUG: org.springframework.security.web.FilterChainProxy - /login.jsp at position 8 of 11 in additional filter chain; firing Filter: 'org.springframework.security.web.authentication.AnonymousAuthenticationFilter@230be4'
  DEBUG: org.springframework.security.web.authentication.AnonymousAuthenticationFilter - Populated SecurityContextHolder with anonymous token: 'org.springframework.security.authentication.AnonymousAuthenticationToken@905571d8: Principal: anonymousUser; Password: [PROTECTED]; Authenticated: true; Details: org.springframework.security.web.authentication.WebAuthenticationDetails@0: RemoteIpAddress: 0:0:0:0:0:0:0:1; SessionId: 96789943A570362DE4B0113A5262F0CB; Granted Authorities: ROLE_ANONYMOUS'
  </code></pre>