There is no necessary anti-fake cookie "__RequestVerificationToken".

The required anti-fake file "__RequestVerificationToken" is missing.

I added in cshtml and in Controller as well

using (Html.BeginForm()) { @Html.AntiForgeryToken() //some code } [HttpGet] [ValidateAntiForgeryToken] public ActionResult Index() { using (var db = new SampleEntities()) { return View(db.Rfps.ToList()); } } 
+7
asp.net-mvc
source share
3 answers

The problem is that you are setting the ValidateAntiForgeryToken attribute for an action that allows only GET requests. You do not need to use the attribute for GET actions. Look here for more information.

+5
source share

In my case, I had this in my web.config:

<httpCookies requireSSL="true" />

But my project was not configured to use SSL. Commenting on this line or setting up the project to always use SSL, he decided.

+30
source share

In my case, this happened because I previously launched another Asp.Net site. Therefore, cookies cannot match the local host. I cleared my cookies (localhost only) and now everything is fine.

0
source share

All Articles