Update anti-request-forgery.md

Rick-Anderson-patch-12
Rick Anderson 2025-01-07 15:37:00 -10:00 committed by GitHub
parent 84815f60a8
commit 810c299b9d
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
1 changed files with 3 additions and 3 deletions

View File

@ -159,9 +159,9 @@ Calling <xref:Microsoft.Extensions.DependencyInjection.MvcServiceCollectionExten
## Multiple browser tabs and the Synchronizer Token Pattern
With the Synchronizer Token Pattern, only the most recently loaded page is guaranteed to contain a valid antiforgery token. Apps that wish to support multiple tabs should test supported browsers and log failures. ***Using multiple tabs can be problematic***. For example, if a user opens multiple tabs, requests made from previously loaded tabs might fail with an error: `Antiforgery token validation failed. The antiforgery cookie token and request token do not match`
Consider alternative CSRF protection patterns if this poses an issue.
Multiple tabs logged in as different users, or one logged in as anonymous, are not supported.
With the Synchronizer Token Pattern, only the most recently posted page is guaranteed to contain a valid antiforgery token. Apps that wish to support multiple tabs should test supported browsers and log failures.
## Configure antiforgery with `AntiforgeryOptions`