HttpCookieCollection HttpCookieCollection HttpCookieCollection HttpCookieCollection Class

Definition

Provides a collection container for instances of the HttpCookie class.

public : sealed class HttpCookieCollection : IIterable, IVectorViewpublic sealed class HttpCookieCollection : IEnumerable, IReadOnlyListPublic NotInheritable Class HttpCookieCollection Implements IEnumerable, IReadOnlyList// You can use this class in JavaScript.
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

Item[Int32] Item[Int32] Item[Int32] Item[Int32]

Gets the element at the specified index in the read-only list.

This member is not implemented in C++T this[int index] { get; }ReadOnly Property Item(index As Integer) As TT this[int index] { get; }
Parameters
index

The zero-based index of the element to get.

Value
T T T T

The element at the specified index in the read-only list.

Size Size Size Size

Gets the number of cookies in the HttpCookieCollection.

public : unsigned int Size { get; }This member is not implemented in C#This member is not implemented in VB.Net// You can use this property in JavaScript.
Value
unsigned int uint uint uint

The number of cookies in the HttpCookieCollection.

Methods

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

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

public : IIterator<HttpCookie> First()This member is not implemented in C#This member is not implemented in VB.Net// You can use this method in JavaScript.
Returns
See Also

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

Returns the HttpCookie at the specified index from the HttpCookieCollection.

public : HttpCookie GetAt(unsigned int index)This member is not implemented in C#This member is not implemented in VB.Net// You can use this method in JavaScript.
Parameters
index
unsigned int UInt32 UInt32 UInt32

The zero-based index of a specified item in the HttpCookieCollection.

Returns

The HTTP cookie at the specified index from the HttpCookieCollection.

See Also

GetEnumerator() GetEnumerator() GetEnumerator() GetEnumerator()

Returns an enumerator that iterates through the collection.

This member is not implemented in C++IEnumerator<T> GetEnumerator()Function GetEnumerator As IEnumerator(Of T)IEnumerator<T> GetEnumerator()
Returns

An enumerator that can be used to iterate through the collection.

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.

public : unsigned int GetMany(unsigned int startIndex, HttpCookie[] items)This member is not implemented in C#This member is not implemented in VB.Net// You can use this method in JavaScript.
Parameters
startIndex
unsigned int UInt32 UInt32 UInt32

The zero-based index of the start of the HttpCookie items in the HttpCookieCollection.

items
HttpCookie[] HttpCookie[] HttpCookie[] HttpCookie[]

The HttpCookie items that start at startIndex in the HttpCookieCollection.

Returns
unsigned int uint uint uint

The number of HttpCookie items retrieved.

See Also

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

Retrieves the index of an HttpCookie in the HttpCookieCollection.

public : PlatForm::Boolean IndexOf(HttpCookie value, unsigned int index)This member is not implemented in C#This member is not implemented in VB.Net// You can use this method in JavaScript.
Parameters
index
unsigned int UInt32 UInt32 UInt32

The index of the HttpCookie in the HttpCookieCollection.

If the item is found, this is the zero-based index of the item; otherwise, this parameter is 0.

Returns
PlatForm::Boolean bool bool bool

Indicates whether the item is found.

true if the HttpCookie item is found; otherwise, false.

See Also

See Also