title: how AntiForgeryToken() works in MVC and how to retrieve value at server action method from AntiForgeryToken?
body: <p>i was reading about AntiForgeryToken but do not understand the actual use or importance. i saw people wrote a code like in their form as</p>
  
  <pre><code>@using (Html.BeginForm("Create", "Register")) 
  { 
      @Html.AntiForgeryToken()  
  }
  </code></pre>
  
  <p>so what it does....it will generate a unique token and when form will post then this unique toke will pass and as well as a cookie will pass with same unique token value and two unique data will compare at server end that both are equal or not. if not then some tamper occur.</p>
  
  <p>i just do not understand if other form field value change or tamper then how that tampering can be determine. suppose we often store valuable data inside hidden fields. if i need to secure that hidden fields value then how AntiForgeryToken can help us?</p>
  
  <p>can we use AntiForgeryToken to wrap up those valuable data inside it and later compare at server end.</p>
  
  <p>can anyone give me bit of sample code by which i can put 3 valuable data in my page and if tamper then a friendly message will be show to user. guide me how to do it. thanks</p>