System.Web.HttpCookieCollection.Set Method

Updates the value of an existing cookie in a cookie collection.

Syntax

public void Set (HttpCookie cookie)

Parameters

cookie
The System.Web.HttpCookie object to update.

Remarks

The HttpCookieCollection.Set(HttpCookie) method first checks to see if a cookie already exists in the collection and if so updates it. The HttpCookieCollection.Set(HttpCookie) method does not allow duplicate cookies in the cookie collection. To add duplicate cookies in the cookie collection, use the HttpCookieCollection.Add(HttpCookie) method.

Requirements

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