We are using dynamically set culture based on cookies and redirection with Blazor Server, with 100% fidelity on the set-up in the documentation with a CultureController:
public IActionResult Set(string culture, string redirectUri)
{
if (culture != null)
{
HttpContext.Response.Cookies.Append(
CookieRequestCultureProvider.DefaultCookieName,
CookieRequestCultureProvider.MakeCookieValue(
new RequestCulture(culture, culture)));
}
return LocalRedirect(redirectUri);
}
With Chromium based browsers and Safari there are no problems: the Set-Cookie header on the response is working great and then the browser is redirected.
With Firefox though, it seems the request to the controller is being aborted for some reason, thus not receiving the Set-Cookie header before the redirection and ultimately not changing the culture:
Here is the same thing on Chrome where the header is working:
I have checked for Cookie attributes (tried everything: Strict, Secure, etc. No luck), if there were any options to add for the LocalRedirect
to wait and not cancel other requests.
Any leads would be greatly appreciated.
Edit: Additionnal info (StackTrace of the blocked request)
Seems like the request gets canceled by Blazor SignalR connection reset, which seems to have a timing issue only on Firefox from what I understand (or Firefox treats it differently somehow).