fixed culture cookie missing attributes like samesite
This commit is contained in:
parent
1223b7f428
commit
d40e74307f
|
@ -52,6 +52,10 @@
|
||||||
CookieRequestCultureProvider.MakeCookieValue(
|
CookieRequestCultureProvider.MakeCookieValue(
|
||||||
new RequestCulture(
|
new RequestCulture(
|
||||||
CultureInfo.CurrentCulture,
|
CultureInfo.CurrentCulture,
|
||||||
CultureInfo.CurrentUICulture)));
|
CultureInfo.CurrentUICulture)), new CookieOptions {
|
||||||
|
Expires = DateTimeOffset.UtcNow.AddYears(1),
|
||||||
|
IsEssential = true,
|
||||||
|
SameSite = SameSiteMode.Strict
|
||||||
|
});
|
||||||
}
|
}
|
||||||
}
|
}
|
|
@ -11,7 +11,11 @@ public class LanguageController : ControllerBase {
|
||||||
Response.Cookies.Append(
|
Response.Cookies.Append(
|
||||||
CookieRequestCultureProvider.DefaultCookieName,
|
CookieRequestCultureProvider.DefaultCookieName,
|
||||||
CookieRequestCultureProvider.MakeCookieValue(new RequestCulture(culture)),
|
CookieRequestCultureProvider.MakeCookieValue(new RequestCulture(culture)),
|
||||||
new CookieOptions { Expires = DateTimeOffset.UtcNow.AddYears(1) }
|
new CookieOptions {
|
||||||
|
Expires = DateTimeOffset.UtcNow.AddYears(1),
|
||||||
|
IsEssential = true,
|
||||||
|
SameSite = SameSiteMode.Strict
|
||||||
|
}
|
||||||
);
|
);
|
||||||
|
|
||||||
return LocalRedirect(string.IsNullOrWhiteSpace(returnUrl) ? "/" : returnUrl);
|
return LocalRedirect(string.IsNullOrWhiteSpace(returnUrl) ? "/" : returnUrl);
|
||||||
|
|
Loading…
Reference in a new issue