System.Net.CookieContainer.GetCookieHeader Method

Gets the HTTP cookie header that contains the HTTP cookies that represent the System.Net.Cookie instances that are associated with a specific URI.

Syntax

public string GetCookieHeader (Uri uri)

Parameters

uri
The URI of the System.Net.Cookie instances desired.

Returns

An HTTP cookie header, with strings representing System.Net.Cookie instances delimited by semicolons.

Remarks

CookieContainer.GetCookieHeader(Uri) returns a string that holds the HTTP cookie header for the System.Net.Cookie instances specified by uri. The HTTP header is built by adding a string representation of each System.Net.Cookie associated with uri. Note that the exact format of the string depends on the RFC that the System.Net.Cookie conforms to. The strings for all the System.Net.Cookie instances that are associated with uri are combined and delimited by semicolons.

This string is not in the correct format for use as the second parameter of the CookieContainer.SetCookies(Uri, string) method.

Requirements

Namespace: System.Net
Assembly: System (in System.dll)
Assembly Versions: 1.0.5000.0, 2.0.0.0, 4.0.0.0