RoleManagerSection.CookieProtection Eigenschap

Definitie

Hiermee haalt u het type beveiliging op dat wordt gebruikt om de cookie te beveiligen die rolnamen in de cache opgeslagen.

public:
 property System::Web::Security::CookieProtection CookieProtection { System::Web::Security::CookieProtection get(); void set(System::Web::Security::CookieProtection value); };
[System.Configuration.ConfigurationProperty("cookieProtection", DefaultValue=System.Web.Security.CookieProtection.All)]
public System.Web.Security.CookieProtection CookieProtection { get; set; }
[<System.Configuration.ConfigurationProperty("cookieProtection", DefaultValue=System.Web.Security.CookieProtection.All)>]
member this.CookieProtection : System.Web.Security.CookieProtection with get, set
Public Property CookieProtection As CookieProtection

Waarde van eigenschap

Het type beveiliging dat wordt gebruikt in de cookie waar rolnamen in de cache worden opgeslagen. De standaardwaarde is All.

Kenmerken

Voorbeelden

In het volgende codevoorbeeld ziet u hoe u de CookieProtection eigenschap gebruikt. Dit codevoorbeeld maakt deel uit van een groter voorbeeld voor de RoleManagerSection klasse.

// Display CookieProtection property.
Console.WriteLine("CookieProtection: {0}",
  configSection.CookieProtection);
' Display CookieProtection property.
Console.WriteLine("CookieProtection: {0}", _
 configSection.CookieProtection)

Opmerkingen

De CookieProtection eigenschap beschrijft hoe informatie in een cookie veilig wordt opgeslagen. U kunt het beveiligingstype van de cookie opgeven waarin rollen in de cache voor uw toepassing worden opgeslagen door het kenmerk cookieProtection in te stellen in het Web.config-bestand voor uw ASP.NET toepassing. Het cookieProtection kenmerk heeft een CookieProtection opsommingswaarde van All, Encryptionof NoneValidation. De standaardwaarde is All. Zorg ervoor dat u de standaardwaarde voor de CookieProtection eigenschap gebruikt als u zowel gegevensvalidatie als versleuteling wilt gebruiken om de cookie te beschermen. Om de bescherming van uw cookie te verbeteren, kunt u de CookieRequireSSL eigenschap ook instellen op true.

Van toepassing op

Zie ook