IResponseCookies.Delete Method

Definition

Overloads

Delete(String)

Sets an expired cookie.

Delete(String, CookieOptions)

Sets an expired cookie.

Delete(String)

Source:
IResponseCookies.cs

Sets an expired cookie.

C#
public void Delete (string key);

Parameters

key
String

Name of the cookie to expire.

Applies to

ASP.NET Core 9.0 and other versions
Product Versions
ASP.NET Core 1.0, 1.1, 2.0, 2.1, 2.2, 3.0, 3.1, 5.0, 6.0, 7.0, 8.0, 9.0

Delete(String, CookieOptions)

Source:
IResponseCookies.cs

Sets an expired cookie.

C#
public void Delete (string key, Microsoft.AspNetCore.Http.CookieOptions options);

Parameters

key
String

Name of the cookie to expire.

options
CookieOptions

CookieOptions used to discriminate the particular cookie to expire. The Domain and Path values are especially important.

Applies to

ASP.NET Core 9.0 and other versions
Product Versions
ASP.NET Core 1.0, 1.1, 2.0, 2.1, 2.2, 3.0, 3.1, 5.0, 6.0, 7.0, 8.0, 9.0