Export (0) Print
Expand All

HttpCookiesSection.RequireSSL 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 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

Supported in: 4.6, 4.5, 4, 3.5, 3.0, 2.0
Show:
© 2015 Microsoft