Cookie.Port Property

 
System_CAPS_noteNote

The .NET API Reference documentation has a new home. Visit the .NET API Browser on docs.microsoft.com to see the new experience.

Gets or sets a list of TCP ports that the Cookie applies to.

Namespace:   System.Net
Assembly:  System (in System.dll)

member Port : string with get, set

Property Value

Type: System.String

The list of TCP ports that the Cookie applies to.

Exception Condition
CookieException

The value specified for a set operation could not be parsed or is not enclosed in double quotes.

This attribute restricts the ports to which this Cookie may be sent. The default value means no restriction. Setting this to the empty string ("") will restrict the port to the one used in the HTTP response. Otherwise, the value must be a double-quoted string that contains port values delimited with commas.

The following example displays the properties of cookies returned in a response. For the complete example, see the Cookie class topic.

No code example is currently available or this language may not be supported.

Universal Windows Platform
Available since 8
.NET Framework
Available since 1.1
Portable Class Library
Supported in: portable .NET platforms
Silverlight
Available since 3.0
Windows Phone Silverlight
Available since 7.0
Windows Phone
Available since 8.1
Return to top
Show: