title: Getting 403 with CSRF token in spring security
body: <p>I am encountering an issue with multiple tabs. If i logout from first tab and open another tab and after logging in and logging out if i go back to first tab and login i get 403. For example, the logout page of first tab had following added to the form by spring security and thymeleaf:</p>
  
  <pre><code>&lt;input type="hidden" name="_csrf" value="7b9639ba-aaae-4ed2-aad2-bb4c5930458e"&gt;
  </code></pre>
  
  <p>where as the login form of second tab added a different csrf token.</p>
  
  <pre><code>&lt;input type="hidden" name="_csrf" value="659324d5-ec5c-4c57-9984-dab740746285"&gt;
  </code></pre>
  
  <p>Now when i go to first tab and login from there i get 403 forbidden. Which makes sense since csrf token is now stale. But how do i get around this? I am also getting 403 forbidden if the user was logged out from inactivity and redirected to login page but tried logging in again only after a while, say half an hour.</p>