Skip to content

Open-source eCommerce platform for C# and ASP.NET Core 10 with MongoDB. Build multi-store shops and multi-vendor marketplaces with B2B/B2C, REST API, plugins, Vue 3 and Docker.

Antiforgery - Specifies the name of the header value that is used by the antiforgery system

supportaef0852791b2
diff --git a/src/Web/Grand.Web.Common/Infrastructure/ServiceCollectionExtensions.cs b/src/Web/Grand.Web.Common/Infrastructure/ServiceCollectionExtensions.cs
index d9f6952f6..2366b804a 100644
--- a/src/Web/Grand.Web.Common/Infrastructure/ServiceCollectionExtensions.cs
+++ b/src/Web/Grand.Web.Common/Infrastructure/ServiceCollectionExtensions.cs
@@ -54,6 +54,7 @@ namespace Grand.Web.Common.Infrastructure
options.Cookie = new CookieBuilder {
Name = $"{config.CookiePrefix}Antiforgery"
};
+ options.HeaderName = "X-CSRF-TOKEN";
if (DataSettingsManager.DatabaseIsInstalled())
{
//whether to allow the use of anti-forgery cookies from SSL protected page on the other store pages which are not