After copying the code sample provided for use with AngularJS, I noticed that two antiforgery cookies are being added: XSRF-TOKEN and .AspNetCore.Antiforgery.xxxxxxxxxxx. This appears to be because we're calling antiforgery.GetAndStoreTokens(context) rather than antiforgery.GetTokens(context).
Given that GetAndStoreTokens will add the cookie on our behalf anyway, maybe the sample should just set the name of the cookie when configuring the service (which is what I have done in my application).
Document Details
⚠ Do not edit this section. It is required for docs.microsoft.com ➟ GitHub issue linking.
After copying the code sample provided for use with AngularJS, I noticed that two antiforgery cookies are being added:
XSRF-TOKENand.AspNetCore.Antiforgery.xxxxxxxxxxx. This appears to be because we're callingantiforgery.GetAndStoreTokens(context)rather thanantiforgery.GetTokens(context).Given that
GetAndStoreTokenswill add the cookie on our behalf anyway, maybe the sample should just set the name of the cookie when configuring the service (which is what I have done in my application).Document Details
⚠ Do not edit this section. It is required for docs.microsoft.com ➟ GitHub issue linking.