Secure Property
Collapse the table of content
Expand the table of content

HttpCookie.Secure Property

Gets or sets a value indicating whether to transmit the cookie using SSL (that is, over HTTPS only).

[Visual Basic]
Public Property Secure As Boolean
[C#]
public bool Secure {get; set;}
[C++]
public: __property bool get_Secure();
public: __property void set_Secure(bool);
[JScript]
public function get Secure() : Boolean;
public function set Secure(Boolean);

Property Value

true to transmit the cookie over an SSL connection; otherwise, false. The default value is false.

Example

The following example takes action if the cookie is set to transmit using SSL.

[Visual Basic] 
If MyCookie.Secure Then
    '...
 End If
    

[C#] 
if (MyCookie.Secure)
 {
   //...
 }
    

[C++] 
if (MyCookie->Secure)
 {
   //...
 }
    

[JScript] 
if(myCookie.Secure){
    //...
 }
    

Requirements

Platforms: Windows 2000, Windows XP Professional, Windows Server 2003 family

See Also

HttpCookie Class | HttpCookie Members | System.Web Namespace

Show:
© 2016 Microsoft