IAntiforgery.GetAndStoreTokens(HttpContext) Méthode

Définition

Génère un AntiforgeryTokenSet pour cette demande et stocke le jeton de cookie dans la réponse. Cette opération définit également les en-têtes « Cache-control » et « Pragma » sur « no-cache » et l’en-tête « X-Frame-Options » sur « SAMEORIGIN ».

public:
 Microsoft::AspNetCore::Antiforgery::AntiforgeryTokenSet ^ GetAndStoreTokens(Microsoft::AspNetCore::Http::HttpContext ^ httpContext);
public Microsoft.AspNetCore.Antiforgery.AntiforgeryTokenSet GetAndStoreTokens (Microsoft.AspNetCore.Http.HttpContext httpContext);
abstract member GetAndStoreTokens : Microsoft.AspNetCore.Http.HttpContext -> Microsoft.AspNetCore.Antiforgery.AntiforgeryTokenSet
Public Function GetAndStoreTokens (httpContext As HttpContext) As AntiforgeryTokenSet

Paramètres

httpContext
HttpContext

HttpContext associé à la demande actuelle.

Retours

AntiforgeryTokenSet avec des jetons pour la réponse.

Remarques

Cette méthode a un effet secondaire : un cookie de réponse est défini si aucun cookie valide n’est associé à la demande.

S’applique à