Share via


WebBrowserExtensions.GetCookies Method

[ This article is for Windows Phone 8 developers. If you’re developing for Windows 10, see the latest documentation. ]

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)

Syntax

<ExtensionAttribute> _
Public Shared Function GetCookies ( _
    browserControl As WebBrowser _
) As CookieCollection
public static CookieCollection GetCookies(
    this WebBrowser browserControl
)

Parameters

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.

Remarks

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.

Version Information

Windows Phone OS

Supported in: 8.1, 8.0, 7.1

Platforms

Windows Phone

See Also

Reference

WebBrowserExtensions Class

Microsoft.Phone.Controls Namespace