HttpCookiesSection.RequireSSL Property

 

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

Gets or sets a value indicating whether Secure Sockets Layer (SSL) communication is required.

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

[ConfigurationPropertyAttribute("requireSSL", DefaultValue = false)]
public bool RequireSSL { get; set; }

Property Value

Type: System.Boolean

true if SSL is enabled; otherwise, false. The default is false.

The RequireSSL property enables or disables output of the secure cookie attribute as described in RFC 2109. When used by compliant browsers, the cookie will only be sent back over a connection using SSL/TLS. The default is false.

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


// Get the current RequireSSL.
Boolean requireSSLValue = 
    httpCookiesSection.RequireSSL;

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

.NET Framework
Available since 2.0
Return to top
Show: