This might be a simple question, I\'m hoping it is at least.
I\'ve started to look into the Release Candidate of ASP.NET Core and I can see that a lot of the configu
It's an old question, but I didn't see this answer anywhere so here goes.
As for configuring the behavior of cookies globally you can do it in the Startup.
public void ConfigureServices(IServiceCollection services)
{
services.Configure(options =>
{
options.CheckConsentNeeded = context => true;
options.MinimumSameSitePolicy = SameSiteMode.None;
options.HttpOnly = HttpOnlyPolicy.Always;
options.Secure = CookieSecurePolicy.Always;
// you can add more options here and they will be applied to all cookies (middleware and manually created cookies)
});
...
}
As for doing this in a manner that you have different configurations per environment I still haven't found a way of doing it myself.