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

CookieContainer.GetCookieHeader Method

Gets the HTTP cookie header that contains cookies pertaining to the specified Uniform Resource Identifier (URI).

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

public string GetCookieHeader(
	Uri uri


Type: System.Uri
The URI to retrieve cookies for.

Return Value

Type: System.String
A string representing the cookie header associated with the specified URI.


uri is null.

The HTTP cookie header is created by adding a string representation of each cookie associated with the specified URI; seperating each cookie in the string with a semicolon. The exact format of each cookie string depends on the RFC the cookie conforms to.


Supported in: 5, 4, 3

Silverlight for Windows Phone

Supported in: Windows Phone OS 7.1, Windows Phone OS 7.0

XNA Framework

Supported in: Windows Phone OS 7.0

For a list of the operating systems and browsers that are supported by Silverlight, see Supported Operating Systems and Browsers.

Community Additions

© 2015 Microsoft