ToString Method
Collapse the table of content
Expand the table of content

Cookie.ToString Method ()


Overrides the Object.ToString method.

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

public override string ToString()

Return Value

Type: System.String

Returns a string representation of this Cookie object that is suitable for including in a HTTP Cookie: request header.

The exact format of the string depends on the RFC that this cookie conforms to.

The following example displays the string value of a cookie returned in a response. For the complete example, see the Cookie class topic.

// Show the string representation of the cookie.
Console.WriteLine ("String: {0}", cook.ToString());

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