1

When i publish my application from my local development server to the shared hosting server i get an error the first time someone logs in.

Error in Controller Account, Action method Login. Exception: The anti-forgery cookie token and form field token do not match.

I've tried adding a machinekey but that didn't seem to make a difference. I am refreshing the login page prior to trying to login. Seems like the same issue as this

The anti-forgery cookie token and form field token do not match in MVC 4

but the machine key didn't solve it. My application is ASP.Net 4.5.1 MVC5.1

Community
  • 1
  • 1
Tim
  • 7,401
  • 13
  • 61
  • 102
  • You are only setting the `ValidateAntiForgeryToken` attribute on the POST action method, right? From your description it sounds like the error is happening on a GET. Just making sure. – Andy T Mar 19 '14 at 00:39
  • @QuetiM.Porta its the code from the initial MVC5.1 template im using. but yes its on the accountcontroller login post action which has the [ValidateAntiForgeryToken] attribute. Yes the error is on posting login credentials (loggin in). – Tim Mar 19 '14 at 06:25

0 Answers0