Export (0) Print
Expand All

HttpCookiesSection.HttpOnlyCookies Property

This API supports the .NET Framework infrastructure and is not intended to be used directly from your code.

Gets or sets a value indicating whether the support for the browser's HttpOnly cookie is enabled.

Namespace:  System.Web.Configuration
Assembly:  System.Web (in System.Web.dll)

'Declaration
<ConfigurationPropertyAttribute("httpOnlyCookies", DefaultValue := False)> _
Public Property HttpOnlyCookies As Boolean

Property Value

Type: System.Boolean
true if support for the HttpOnly cookie is enabled; otherwise, false. The default is false.

The httpCookies element supports the use of HttpOnly cookies. HttpOnly cookies (cookies with the HttpOnly attribute) were introduced in Internet Explorer 6 to help mitigate the risk of cross-site scripting. The HttpOnly attribute prevents cookies from being accessed through client-side script. Any information contained in an HttpOnly cookie is less likely to be disclosed to a hacker or a malicious Web site. For more information, search MSDN (msdn.microsoft.com) for "HttpOnly."

The following code example shows how to use the HttpOnlyCookies property.



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

            ' Set the HttpOnlyCookies.
            httpCookiesSection.HttpOnlyCookies = _
            False



.NET Framework

Supported in: 4, 3.5, 3.0, 2.0

Windows 7, Windows Vista SP1 or later, Windows XP SP3, Windows XP SP2 x64 Edition, Windows Server 2008 (Server Core not supported), Windows Server 2008 R2 (Server Core supported with SP1 or later), Windows Server 2003 SP2

The .NET Framework does not support all versions of every platform. For a list of the supported versions, see .NET Framework System Requirements.

Community Additions

ADD
Show:
© 2014 Microsoft