Cookie.Name Property

 

Gets or sets the name for the Cookie.

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

member Name : string with get, set

Property Value

Type: System.String

The name for the Cookie.

Exception Condition
CookieException

The value specified for a set operation is null or the empty string

- or -

The value specified for a set operation contained an illegal character. The following characters must not be used inside the Name property: equal sign, semicolon, comma, newline (\n), return (\r), tab (\t), and space character. The dollar sign character ("$") cannot be the first character.

The Name property must be initialized before using an instance of the Cookie class.

The following characters are reserved and cannot be used for this attribute value: equal sign, semicolon, comma, new line (\n), return (\r), tab (\t), and space character. The dollar sign ($) character cannot be the first character.

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: