CookieHandler.HideFromClientScript Property

.NET Framework (current version)

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

Namespace:   System.IdentityModel.Services
Assembly:  System.IdentityModel.Services (in System.IdentityModel.Services.dll)

public virtual bool HideFromClientScript { get; set; }

Property Value

Type: System.Boolean

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

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.

.NET Framework
Available since 4.5
Return to top