ASP.net core auth cookie not being set in Google Chrome when running in dev

Hi I had this problem too.

While my localhost environment in VS worked fine and my user could be logged in this didn't worked in the published environment for chrome.

This began when I was trying some self-signed-certificate stuff in IIS on my pre-production-environment by turining on https with configured bindings. And after that I went back to http.

What you could try in Chrome is this: Open the developer-tools goto tab Application and in the left pane choose Clear storage. Under the diagram on the right click Clear site data even if the usage shows 0 Bytes used. Do it anyway.

Finally I got my application with login features back.

Hope that this will help someone, too.


I had the same problem, it worked in IE, Edge but not in Chrome, Firefox and Opera.

It seem a cookie size problem, and I solved reducing the data in the cookie.

See this for size limits: chrome cookie size limit


In my case, we had a C# ASP.NET Core 2.1 MVC application which was working fine when I launch in Google Chrome. But one fine day it stopped working.

In Google Chrome Developer Tools I saw below

First, I noticed that Application -> Cookies .AspNetCore.Session was missing.

Second, in Console I noticed below warning.

A cookie associated with a resource at http://myapplication.company.net/ was set with SameSite=None but without Secure. It has been blocked, as Chrome now only delivers cookies marked SameSite=None if they are also marked Secure. You can review cookies in developer tools under Application>Storage>Cookies and see more details at https://www.chromestatus.com/feature/5633521622188032.

I did below to fix it.

In our application, in Startup.cs I had like below

public void ConfigureServices(IServiceCollection services)
{
  services.Configure<CookiePolicyOptions>(options =>
  {
     options.MinimumSameSitePolicy = SameSiteMode.None;
     
  });
}

We changed like below

public void ConfigureServices(IServiceCollection services)
{
  services.Configure<CookiePolicyOptions>(options =>
  {
     options.MinimumSameSitePolicy = SameSiteMode.Strict;
     
  });
}

It solved the issue. I also noticed that in Developer Tools now I can see Application -> Cookies .AspNetCore.Session