Was this page helpful?
Your feedback about this content is important. Let us know what you think.
Additional feedback?
1500 characters remaining
Export (0) Print
Expand All

HttpCookieCollection.Remove Method

Removes the cookie with the specified name from the collection.

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

'Declaration
Public Sub Remove ( _
	name As String _
)

Parameters

name
Type: System.String

The name of the cookie to remove from the collection.

If a cookie with the specified name does not exist in the collection, no exception is thrown.

TopicLocation
How to: Delete a CookieBuilding ASP .NET Web Applications
How to: Delete a CookieBuilding ASP .NET Web Applications

The following example removes a cookie from the collection.

MyCookieCollection.Remove(MyCookie)
    

.NET Framework

Supported in: 4.6, 4.5, 4, 3.5, 3.0, 2.0, 1.1
Show:
© 2015 Microsoft