Windows Dev Center

WebBrowserExtensions.GetCookies Method

Returns a collection of cookies retrieved from the Source URI of the specified WebBrowser control.

Namespace:  Microsoft.Phone.Controls
Assembly:  Microsoft.Phone (in Microsoft.Phone.dll)

public static CookieCollection GetCookies(
	this WebBrowser browserControl
)

Parameters

browserControl
Type: Microsoft.Phone.Controls.WebBrowser
The WebBrowser class instance whose Source property is used to retrieve the CookieCollection object.

Return Value

Type: System.Net.CookieCollection
A collection of cookies retrieved from the Source URI of the specified WebBrowser control.

Usage Note

In Visual Basic and C#, you can call this method as an instance method on any object of type WebBrowser. When you use instance method syntax to call this method, omit the first parameter.

You could use the GetCookies method to retrieve cookies associated with a website if you use the WebBrowser control in your application. Once you have retrieved a CookieCollection, you could use the cookies to make subsequent HTTP requests to the website.

The GetCookies method returns a set of HTTP cookies. No other type of cookies is returned.

For more information about how to use the cookie collection when sending web requests, see How to get and set cookies for Windows Phone 8.

Windows Phone OS

Supported in: 8.1, 8.0, 7.1

Windows Phone

Show:
© 2015 Microsoft