title: validation of anti-xsrf token failed
body: <p>I created a new asp.net web forms(with master pages) application for a very simple submission form. I used visual studio 2012 to create the web project and it added the code for preventing cross site script forgery on the site.master.cs.</p>
  
  <p>However upon testing , if a user signs and is inactive for a few minutes, and then clicks logout button,we are getting this error (on the site.master.cs)</p>
  
  <pre><code>Validation of Anti-XSRF token failed.
  
         Exception Details: System.InvalidOperationException: Validation of Anti-XSRF token failed.
  
  Source Error: 
  Line 61:                     || (string)ViewState[AntiXsrfUserNameKey] !=    
  
    (Context.User.Identity.Name ?? String.Empty))
  
   Line 62:                 {
  
   Line 63:                     throw new InvalidOperationException("Validation of Anti-XSRF token failed.");
  
  
     Line 64:                 }
  
   Line 65:             }
  </code></pre>
  
  <p>What can we do to avoid this? </p>