CookieContainer.SetCookies Method
[ This article is for Windows Phone 8 developers. If you’re developing for Windows 10, see the latest documentation. ]
Creates cookie instances for the cookies specified in the HTTP cookie header and adds them to the CookieContainer associated with the specified Uniform Resource Identifier (URI).
Assembly: System.Net (in System.Net.dll)
Parameters
- uri
- Type: System.Uri
The URI associated with the cookie container.
- cookieHeader
- Type: System.String
The HTTP header containing cookies to add to the CookieContainer.
| Exception | Condition |
|---|---|
| ArgumentNullException | uri is null -or- cookieHeader is null |
| CookieException | One of the cookies is invalid. -or- An error occurred while adding one of the cookies to the container. |
Show: