CookieContainer.PerDomainCapacity Property


Gets or sets the number of Cookie instances that a CookieContainer can hold per domain.

 property int PerDomainCapacity { int get(); void set(int value); };
 property int PerDomainCapacity { int get(); };
public int PerDomainCapacity { get; set; }
public int PerDomainCapacity { get; }
member this.PerDomainCapacity : int with get, set
member this.PerDomainCapacity : int
Public Property PerDomainCapacity As Integer
Public ReadOnly Property PerDomainCapacity As Integer

Property Value

The number of Cookie instances that are allowed per domain.


PerDomainCapacity is less than or equal to zero.


(PerDomainCapacity is greater than the maximum allowable number of cookies instances, 300, and is not equal to MaxValue).


If the new PerDomainCapacity value is less than the current value, and if any of the domain collections contain more Cookie instances than the new value, the collections are pruned to fit. This uses the same basic rules as described in the Capacity property. However, this does the clean-up only on the collection for this domain.

Applies to

See also