System.Web.HttpCookieCollection.Add Method

Adds the specified cookie to the cookie collection.

Syntax

public void Add (HttpCookie cookie)

Parameters

cookie
The System.Web.HttpCookie to add to the collection.

Remarks

Any number of cookie collections can exist within an application, but only the collection referenced by the intrinsic HttpResponse.Cookies object is sent to the client.

The HttpCookieCollection.Add(HttpCookie) method allows duplicate cookies in the cookie collection. Use the HttpCookieCollection.Set(HttpCookie) method to ensure the uniqueness of cookies in the cookie collection.

Requirements

Namespace: System.Web
Assembly: System.Web (in System.Web.dll)
Assembly Versions: 1.0.5000.0, 2.0.0.0