AnonymousIdentificationSection.CookieProtection Eigenschap

Definitie

Hiermee haalt u het versleutelingstype op dat wordt gebruikt voor het versleutelen van de cookie.

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.Validation)]
public System.Web.Security.CookieProtection CookieProtection { get; set; }
[<System.Configuration.ConfigurationProperty("cookieProtection", DefaultValue=System.Web.Security.CookieProtection.Validation)>]
member this.CookieProtection : System.Web.Security.CookieProtection with get, set
Public Property CookieProtection As CookieProtection

Waarde van eigenschap

Een van de CookieProtection waarden. De standaardwaarde is All.

Kenmerken

Voorbeelden

In het volgende codevoorbeeld ziet u hoe u toegang hebt tot de CookieProtection eigenschap.

// Get CookieProtection.
System.Web.Security.CookieProtection cookieProtection =
    anonymousIdentificationSection.CookieProtection;
Console.WriteLine("Cookie protection: {0}",
           cookieProtection);
' Get CookieProtection.
Dim cookieProtection _
As System.Web.Security.CookieProtection = _
anonymousIdentificationSection.CookieProtection
Console.WriteLine( _
"Cookie protection: {0}", cookieProtection)

Opmerkingen

Om de bescherming van uw cookie te verbeteren, kunt u de CookieRequireSSL eigenschap ook instellen op true.

Zorg ervoor dat u de standaardwaarde voor deze eigenschap gebruikt als u zowel gegevensvalidatie als versleuteling wilt gebruiken om de cookie te beschermen. Deze optie maakt gebruik van het geconfigureerde algoritme voor gegevensvalidatie. Triple-DES (3DES) wordt gebruikt voor versleuteling, indien beschikbaar en of de sleutel lang genoeg is (48 bytes of meer).

Van toepassing op