Windows apps
Collapse the table of content
Expand the table of content
Information
The topic you requested is included in another documentation set. For convenience, it's displayed below. Choose Switch to see the topic in its original location.

HttpCookieCollection::Set Method (HttpCookie^)

 

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

Namespace:   System.Web
Assembly:  System.Web (in System.Web.dll)

public:
void Set(
	HttpCookie^ cookie
)

Parameters

cookie
Type: System.Web::HttpCookie^

The HttpCookie object to update.

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

The following example updates the value of an existing cookie.

No code example is currently available or this language may not be supported.

.NET Framework
Available since 1.1
Return to top
Show:
© 2017 Microsoft