Share via


HttpCookiesSection.HttpOnlyCookies Eigenschaft

Definition

Ruft einen Wert ab, der angibt, ob die Unterstützung für das HttpOnly-Cookie des Browsers aktiviert ist, oder legt diesen fest.

Diese API unterstützt die Produktinfrastruktur und ist nicht für die direkte Verwendung aus Ihrem Code gedacht.

public:
 property bool HttpOnlyCookies { bool get(); void set(bool value); };
[System.Configuration.ConfigurationProperty("httpOnlyCookies", DefaultValue=false)]
public bool HttpOnlyCookies { get; set; }
[<System.Configuration.ConfigurationProperty("httpOnlyCookies", DefaultValue=false)>]
member this.HttpOnlyCookies : bool with get, set
Public Property HttpOnlyCookies As Boolean

Eigenschaftswert

true wenn die Unterstützung für das HttpOnly-Cookie aktiviert ist, andernfalls false. Der Standardwert ist false.

Attribute

Beispiele

Im folgenden Codebeispiel wird die Verwendung der HttpOnlyCookies-Eigenschaft veranschaulicht.


// Get the current HttpOnlyCookies.
Boolean httpOnlyCookiesValue = 
    httpCookiesSection.HttpOnlyCookies;

// Set the HttpOnlyCookies.
httpCookiesSection.HttpOnlyCookies = 
    false;

' Get the current HttpOnlyCookies.
Dim httpOnlyCookiesValue As Boolean = _
httpCookiesSection.HttpOnlyCookies

' Set the HttpOnlyCookies.
httpCookiesSection.HttpOnlyCookies = _
False

Hinweise

Das httpCookies Element unterstützt die Verwendung von HttpOnly Cookies. HttpOnly Cookies (Cookies mit dem HttpOnly Attribut) wurden in Internet Explorer 6 eingeführt, um das Risiko siteübergreifender Skripterstellung zu verringern. Das HttpOnly Attribut verhindert den Zugriff auf Cookies über clientseitige Skripts. Alle in einem HttpOnly Cookie enthaltenen Informationen werden weniger wahrscheinlich an einen Hacker oder eine böswillige Website weitergegeben. Weitere Informationen finden Sie im MSDN (msdn.microsoft.com) nach "HttpOnly".

Gilt für:

Weitere Informationen