CookieCollection CookieCollection CookieCollection CookieCollection Class


Provides a collection container for instances of the Cookie class.

public ref class CookieCollection : System::Collections::ICollection
public class CookieCollection : System.Collections.ICollection
type CookieCollection = class
    interface ICollection
    interface IEnumerable
Public Class CookieCollection
Implements ICollection


The CookieCollection class implements an ICollection interface to provide a general mechanism for handling collections of cookies. For example, this is useful in the case where an application is designed to store cookies for multiple servers.


CookieCollection() CookieCollection() CookieCollection() CookieCollection()

Initializes a new instance of the CookieCollection class.


Count Count Count Count

Gets the number of cookies contained in a CookieCollection.

IsReadOnly IsReadOnly IsReadOnly IsReadOnly

Gets a value that indicates whether a CookieCollection is read-only.

IsSynchronized IsSynchronized IsSynchronized IsSynchronized

Gets a value that indicates whether access to a CookieCollection is thread safe.

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

Gets the Cookie with a specific index from a CookieCollection.

Item[String] Item[String] Item[String] Item[String]

Gets the Cookie with a specific name from a CookieCollection.

SyncRoot SyncRoot SyncRoot SyncRoot

Gets an object to synchronize access to the CookieCollection.


Add(Cookie) Add(Cookie) Add(Cookie) Add(Cookie)

Adds a Cookie to a CookieCollection.

Add(CookieCollection) Add(CookieCollection) Add(CookieCollection) Add(CookieCollection)

Adds the contents of a CookieCollection to the current instance.

Clear() Clear() Clear() Clear()
Contains(Cookie) Contains(Cookie) Contains(Cookie) Contains(Cookie)
CopyTo(Array, Int32) CopyTo(Array, Int32) CopyTo(Array, Int32) CopyTo(Array, Int32)

Copies the elements of a CookieCollection to an instance of the Array class, starting at a particular index.

CopyTo(Cookie[], Int32) CopyTo(Cookie[], Int32) CopyTo(Cookie[], Int32) CopyTo(Cookie[], Int32)

Copies the elements of this CookieCollection to a Cookie array starting at the specified index of the target array.

Equals(Object) Equals(Object) Equals(Object) Equals(Object)

Determines whether the specified object is equal to the current object.

(Inherited from Object)
GetEnumerator() GetEnumerator() GetEnumerator() GetEnumerator()

Gets an enumerator that can iterate through a CookieCollection.

GetHashCode() GetHashCode() GetHashCode() GetHashCode()

Serves as the default hash function.

(Inherited from Object)
GetType() GetType() GetType() GetType()

Gets the Type of the current instance.

(Inherited from Object)
MemberwiseClone() MemberwiseClone() MemberwiseClone() MemberwiseClone()

Creates a shallow copy of the current Object.

(Inherited from Object)
Remove(Cookie) Remove(Cookie) Remove(Cookie) Remove(Cookie)
ToString() ToString() ToString() ToString()

Returns a string that represents the current object.

(Inherited from Object)

Explicit Interface Implementations

ICollection.CopyTo(Array, Int32) ICollection.CopyTo(Array, Int32) ICollection.CopyTo(Array, Int32) ICollection.CopyTo(Array, Int32)
ICollection.IsSynchronized ICollection.IsSynchronized ICollection.IsSynchronized ICollection.IsSynchronized
ICollection.SyncRoot ICollection.SyncRoot ICollection.SyncRoot ICollection.SyncRoot
IEnumerable<Cookie>.GetEnumerator() IEnumerable<Cookie>.GetEnumerator() IEnumerable<Cookie>.GetEnumerator() IEnumerable<Cookie>.GetEnumerator()

Extension Methods

Cast<TResult>(IEnumerable) Cast<TResult>(IEnumerable) Cast<TResult>(IEnumerable) Cast<TResult>(IEnumerable)

Casts the elements of an IEnumerable to the specified type.

OfType<TResult>(IEnumerable) OfType<TResult>(IEnumerable) OfType<TResult>(IEnumerable) OfType<TResult>(IEnumerable)

Filters the elements of an IEnumerable based on a specified type.

AsParallel(IEnumerable) AsParallel(IEnumerable) AsParallel(IEnumerable) AsParallel(IEnumerable)

Enables parallelization of a query.

AsQueryable(IEnumerable) AsQueryable(IEnumerable) AsQueryable(IEnumerable) AsQueryable(IEnumerable)

Converts an IEnumerable to an IQueryable.

Applies to

See also