語言

CookieAuthenticationOptions.CookieHttpOnly 屬性

定義

警告

This property is obsolete and will be removed in a future version. The recommended alternative is Cookie.SameSite.

警告

This property is obsolete and will be removed in a future version. The recommended alternative is Cookie.HttpOnly.

此屬性已過時,未來版本將被移除。 推薦的替代方案是 <seealso cref=“P:Microsoft。AspNetCore.Http.CookieBuilder.HttpOnly“></seealso>Cookie。

判斷瀏覽器是否應該允許客戶端 JavaScript 存取 Cookie。 預設為 true,這表示 cookie 只會傳遞給 http 請求,且不會讓頁面上的腳本存取。

public:
 property bool CookieHttpOnly { bool get(); void set(bool value); };
[System.Obsolete("This property is obsolete and will be removed in a future version. The recommended alternative is Cookie.SameSite.")]
public bool CookieHttpOnly { get; set; }
[System.Obsolete("This property is obsolete and will be removed in a future version. The recommended alternative is Cookie.HttpOnly.")]
public bool CookieHttpOnly { get; set; }
[<System.Obsolete("This property is obsolete and will be removed in a future version. The recommended alternative is Cookie.SameSite.")>]
member this.CookieHttpOnly : bool with get, set
[<System.Obsolete("This property is obsolete and will be removed in a future version. The recommended alternative is Cookie.HttpOnly.")>]
member this.CookieHttpOnly : bool with get, set
Public Property CookieHttpOnly As Boolean

屬性值

屬性

適用於