Question

I have finished a website with MVC.NET 4.0, and everything works perfectly on my localhost. However, when I uploaded the site on my server, and try to login with my username and password, I am getting an error when I log in:-

   The required anti-forgery cookie "__RequestVerificationToken" is not present.

What is the problem exactly? Do I need to alter anything in my login action of the account controller?

Thanks for your help

Was it helpful?

Solution

given the brief info, I can only offer a guess at what might be wrong. The Web.config content settings influences behaviour.

If the anti forgorgery token is an SSL (Https) only cookie, and you connect to the website using HTTP only, the cookie is not sent. ( secure cookies not allowed on HTTP)

The receiving controller or controller actions marked to check the anti forgery token then fail. AS teh browser doesnt have a cookie to send.

Check browser accepts cookies and that HTTPs is being used.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top