-
ABP Framework version: v4.4.2
-
UI type: MVC
-
DB provider: EF Core
-
Tiered (MVC) or Identity Server Separated (Angular): no
-
Exception message and stack trace:
-
Steps to reproduce the issue:" 1. Create a ABP mvc project
-
2.Set application cookie path to Application folder rather than default root path '/ by
context.Services.ConfigureApplicationCookie(options =>
{
options.Cookie.Path = "/Arc";
options.Cookie.SameSite = SameSiteMode.Strict;
options.Cookie.SecurePolicy = CookieSecurePolicy.Always;
options.Cookie.IsEssential = true;
options.Cookie.HttpOnly = true;
});
3.. Go to developer tools in the browser and check the path. It is still set to default.
6 Answer(s)
-
0
hi
You are configure the
ApplicationCookie
notXSRF
andAntiforgery
.Can you explain the reason to change the
path
? -
0
hi
You are configure the
ApplicationCookie
notXSRF
andAntiforgery
.Can you explain the reason to change the
path
?Hi,
Basically when i hosted the application cookie path is coming as default root path i.e., path='/'.
But i want to set the path to application folder in IIS when hosted.
Can you please help to set that properly.
-
0
hi
-
0
After setting the cookie path. we are not able to login.
I am getting error like this :
2021-09-18 19:59:22.135 -07:00 [INF] Antiforgery token validation failed. The required antiforgery cookie ".AspNetCore.Antiforgery.BAuz9xcm0sM" is not present.
Microsoft.AspNetCore.Antiforgery.AntiforgeryValidationException: The required antiforgery cookie ".AspNetCore.Antiforgery.BAuz9xcm0sM" is not present.
at Microsoft.AspNetCore.Antiforgery.DefaultAntiforgery.ValidateRequestAsync(HttpContext httpContext)
at Microsoft.AspNetCore.Mvc.ViewFeatures.Filters.ValidateAntiforgeryTokenAuthorizationFilter.OnAuthorizationAsync(AuthorizationFilterContext context)
2021-09-18 19:59:22.254 -07:00 [INF] Authorization failed for the request at filter 'Microsoft.AspNetCore.Mvc.ViewFeatures.Filters.AutoValidateAntiforgeryTokenAuthorizationFilter'.
2021-09-18 19:59:22.260 -07:00 [INF] Executing HttpStatusCodeResult, setting HTTP status code 400 -
0
hi
We could set the Application Cookie's path as per your reply, we are missing antiforgery token and not able to authenticate. Can you please help us.
-
0
hi
I think we should not change the path, IIS will automatically handle it.
We seem to be stuck in the X Y problem. https://xyproblem.info/