title: Invalid CSRF Token - error in chrome browser
body: <p>I am working on a web application built using Spring framework. I am getting <code>Invalid CSRF Token</code> error. I see this behavior only in Chrome browser. Following are the steps followed:</p>
  
  <ol>
  <li>Login to the application by providing userName and password</li>
  <li>Click on Logout button to logout. The user will be re-directed to the login page</li>
  <li>Then, in the login page again try to login. I am getting the below error</li>
  </ol>
  
  <p><code>Invalid CSRF Token 'd82dfa89-81b1-449e-9ef5-cdd32957e7f3' was found on the request parameter '_csrf' or header 'X-CSRF-TOKEN'.</code></p>
  
  <p><strong>Spring security configuration:</strong></p>
  
  <pre><code>http.
       addFilter(headerAdminFilter).
       authorizeRequests().
       regexMatchers("/login.*").permitAll().
       regexMatchers("/api.*").fullyAuthenticated().
       regexMatchers("/jolokia.*").hasRole(ADMINISTRATOR).
       regexMatchers("/appadmin.*").hasRole(ADMINISTRATOR).
       regexMatchers(".*").fullyAuthenticated().
   and().
       formLogin().loginPage("/login").successHandler(new RedirectingAuthenticationSuccessHandler()).
   and().
        exceptionHandling().authenticationEntryPoint(new RestAwareAuthenticationEntryPoint("/login"));
  </code></pre>
  
  <p><strong>HTML code for Logout button:</strong></p>
  
  <pre><code>&lt;a id="logout-button" ng-click="ac.logout()" href="/login"&gt;Log Out&lt;/a&gt;
  </code></pre>
  
  <p><strong>AngularJS code for logout function:</strong></p>
  
  <pre><code>this.logout = function () {
      $http.post("/logout");
  }
  </code></pre>