CookieHandler.HideFromClientScript Property

Definition

Gets or sets a value that indicates whether the cookie should be hidden from client script.

C#
public virtual bool HideFromClientScript { get; set; }

Property Value

true if the cookie should be hidden from client script; otherwise, false. The default is true.

Remarks

Controls whether the "HttpOnly" flag is emitted in the Set-Cookie header for cookies written by the handler. Some web browsers honor this flag by keeping client-side script from accessing the cookie value.

This property corresponds to the HttpCookie.HttpOnly property.

The property can be initialized by specifying the hideFromScript attribute on the <cookieHandler> element in configuration.

Applies to

Product Versions
.NET Framework 4.5, 4.5.1, 4.5.2, 4.6, 4.6.1, 4.6.2, 4.7, 4.7.1, 4.7.2, 4.8, 4.8.1