HttpCookieCollection HttpCookieCollection HttpCookieCollection HttpCookieCollection HttpCookieCollection Class

Definition

Provides a collection container for instances of the HttpCookie class.

public : sealed class HttpCookieCollection
struct winrt::Windows::Web::Http::HttpCookieCollection
public sealed class HttpCookieCollection
Public NotInheritable Class HttpCookieCollection
// This class does not provide a public constructor.
Attributes

Windows 10 requirements

Device family
Windows 10 (introduced v10.0.10240.0)
API contract
Windows.Foundation.UniversalApiContract (introduced v1)

Remarks

The GetCookies method on HttpCookieManager returns an HttpCookieCollection object. This is the method that an HttpCookieCollection is constructed.

Enumerating the collection in C# or Microsoft Visual Basic

HttpCookieCollection is enumerable, so you can use language-specific syntax such as foreach in C# to enumerate the items in the collection. The compiler does the type-casting for you and you won't need to cast to IEnumerable<HttpCookie> explicitly. If you do need to cast explicitly, for example if you want to call GetEnumerator, cast to IEnumerable with an HttpCookie constraint.

Properties

Size Size Size Size Size

Gets the number of cookies in the HttpCookieCollection.

Methods

First() First() First() First() First()

Retrieves an iterator to the first HttpCookie item in the HttpCookieCollection.

GetAt(UInt32) GetAt(UInt32) GetAt(UInt32) GetAt(UInt32) GetAt(UInt32)

Returns the HttpCookie at the specified index from the HttpCookieCollection.

GetMany(UInt32, HttpCookie[]) GetMany(UInt32, HttpCookie[]) GetMany(UInt32, HttpCookie[]) GetMany(UInt32, HttpCookie[]) GetMany(UInt32, HttpCookie[])

Retrieves the HttpCookie items that start at the specified index in the HttpCookieCollection.

IndexOf(HttpCookie, UInt32) IndexOf(HttpCookie, UInt32) IndexOf(HttpCookie, UInt32) IndexOf(HttpCookie, UInt32) IndexOf(HttpCookie, UInt32)

Retrieves the index of an HttpCookie in the HttpCookieCollection.

See also