The required antiforgery cookie is not present error: When registering first user in new asp.net 5 project in Chrome only

I am using Visual Studio 2015 Enterprise and my dnx version is the latest (rc1-update 1). When I create a new web project from scratch with Individual User Accounts and I load the website and fill out the form to register the first user I instantly get the following error:

An unhandled exception occurred while processing the request.

InvalidOperationException: The required antiforgery cookie "9tyjs755shX" is not present.
Microsoft.AspNet.Antiforgery.DefaultAntiforgeryTokenStore.<GetRequestTokensAsync>d__4.MoveNext()

InvalidOperationException: The required antiforgery cookie "9tyjs755shX" is not present.

This has to be some kind of ASP.NET 5 bug because everything I am using is default and freshly installed. The error only happens when using Chrome browser. If anyone wants to reproduce simply create a new web app from scratch with individual user accounts, load the website in Chrome, try and register a user.

Answers


One in the category of: "Have you tried turning it off and on again."

I've removed my browser history (cookies) and it now works.

How I found it: I tried it in Incognito mode and worked straight away without any code change.


I just tried to reproduce your problem and cannot.

There are a couple of things to check;

  1. View the source of the login page and ensure the __RequestVerificationToken hidden field is present

  2. In Developer Tools look at Cookies under The resources tab. Look for a cookie which has a matching value for the __RequestVerificationToken field.

Both must be present.


Need Your Help

Logstash: Handling of large messages

json elasticsearch logstash logstash-file

I'm trying to parse a large message with Logstash using a file input, a json filter, and an elasticsearch output. 99% of the time this works fine, but when one of my log messages is too large, I get

Stopping a Thread

c# multithreading

Here is the situation. I have a thread that gets started with the click of a button. It then works for approx 2 min (give or take quite a bit) and then finishes, updating the UI and all along the...