A free and open-source web framework that enables developers to create web apps using C# and HTML, developed by Microsoft.
CookiePolicyOptions interfering with localization cookie in Blazor server-side app
I have a Blazor server-side and I have the following cookie policy options set up:
services.Configure<CookiePolicyOptions>(options =>
{
options.CheckConsentNeeded = context => true;
options.MinimumSameSitePolicy = SameSiteMode.None;
});
The app also implements cookie localization as described in this MS article.
However, the problem is that with the above policy options, the localization cookie is not being created.
If I change the policy options to (or remove them completely):
services.Configure<CookiePolicyOptions>(options =>
{
options.MinimumSameSitePolicy = SameSiteMode.Unspecified;
});
The localization cookie is created and localization works as expected. So the original options are interfering with the localization cookie.
A sample Blazor project experiencing this problem is found in this GitHub repo.
Is there a solution/workaround in which I have the original cookie policy options (required for consent) and also a working localization cookie?