title: Spring Security: How can I set a RememberMe cookie url path, that differs from the context path?
body: <p>How in Spring Security can I set a RememberMe cookie url path, that differs from the context path?</p>
  
  <p>Supposing my website's homepage url is (url rewrite):</p>
  
  <pre><code>https://www.mysuperspecialdomain.com
  </code></pre>
  
  <p>And that my login page has a url like this:</p>
  
  <pre><code>https://www.mysuperspecialdomain.com/shop/account/login
  </code></pre>
  
  <p>After succesful login the RememberMe cookie has the path <code>/shop</code> (visible in the browser, e.g. Chrome). This is the project's context path.</p>
  
  <p>This leads to the situation, that when I'm going to my homepage, RememberMe is not logging in. Only when I navigate to a url, that starts with <code>https://www.myspecialdomain.com/shop</code> it's doing it.</p>