Was this page helpful?
Your feedback about this content is important. Let us know what you think.
Additional feedback?
1500 characters remaining
ToString Method
Collapse the table of content
Expand the table of content

Cookie.ToString Method

Overrides the Object.ToString method.

Namespace:  System.Net
Assemblies:   System.Net.Primitives (in System.Net.Primitives.dll)
  System (in System.dll)

'Declaration
Public Overrides Function ToString As String

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())

.NET Framework

Supported in: 4.6, 4.5, 4, 3.5, 3.0, 2.0, 1.1

.NET Framework Client Profile

Supported in: 4, 3.5 SP1

.NET for Windows Phone apps

Supported in: Windows Phone 8.1, Windows Phone Silverlight 8.1, Windows Phone Silverlight 8

Portable Class Library

Supported in: Portable Class Library
Show:
© 2015 Microsoft