title: Add expire to Spring Security remember me cookie
body: <p>I'm using Spring Boot 1.4.2 (with embedded Tomcat), Spring MVC 4.3.4  and Spring Security 4.1.3  to build a simple website. My login page contains a remember me Checkbox, which toggles whether or not a remember me cookie is created by Spring Security.</p>
  
  <p>This cookie is set perfectly fine in Chrome and Firefox, but as IE and MS Edge do not use the <code>Max-Age</code> attribute those only create a session cookie. Is there a way to have Spring Security (additionally to <code>Max-Age</code>) set the <code>Expire</code> attribute on the <code>Set-Cookie</code> header for the remember me cookie?</p>
  
  <p>Below is my Spring Security configuration:</p>
  
  <pre class="lang-java prettyprint-override"><code>    http.authorizeRequests()
              .antMatchers("/admin/**").hasRole("ADMIN")
              .antMatchers("/private/**").authenticated()
              .anyRequest().permitAll()
              .and()
          .httpBasic()
              .and()
          .formLogin()
              .loginPage("/login").permitAll().and()
          .rememberMe()
              .tokenValiditySeconds(365 * 24 * 60 * 60)
              .and()
          .sessionManagement()
              .sessionCreationPolicy(SessionCreationPolicy.IF_REQUIRED);
  </code></pre>