Freigeben über


AnonymousIdentificationSection.CookieProtection Eigenschaft

Definition

Ruft den Verschlüsselungstyp ab, der zum Verschlüsseln des Cookies verwendet wird, oder legt diesen fest.

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

Eigenschaftswert

Einer der CookieProtection Werte. Der Standardwert ist All.

Attribute

Beispiele

Das folgende Codebeispiel zeigt, wie Sie auf die CookieProtection Eigenschaft zugreifen.

// 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)

Hinweise

Um den Schutz Ihres Cookies zu verbessern, sollten Sie die CookieRequireSSL Eigenschaft auch auf truefestlegen.

Achten Sie darauf, den Standardwert für diese Eigenschaft zu verwenden, wenn Sie sowohl die Datenüberprüfung als auch die Verschlüsselung zum Schutz des Cookies verwenden möchten. Diese Option verwendet den konfigurierten Datenüberprüfungsalgorithmus. Triple-DES (3DES) wird für die Verschlüsselung verwendet, sofern verfügbar und der Schlüssel lang genug ist (48 Bytes oder mehr).

Gilt für: