IResponseCookies.Append Method

Definition

Overloads

Append(ReadOnlySpan<KeyValuePair<String,String>>, CookieOptions)

Add elements of specified collection as cookies.

Append(String, String)

Add a new cookie and value.

Append(String, String, CookieOptions)

Add a new cookie.

Append(ReadOnlySpan<KeyValuePair<String,String>>, CookieOptions)

Source:
IResponseCookies.cs

Add elements of specified collection as cookies.

C#
public virtual void Append (ReadOnlySpan<System.Collections.Generic.KeyValuePair<string,string>> keyValuePairs, Microsoft.AspNetCore.Http.CookieOptions options);

Parameters

keyValuePairs
ReadOnlySpan<KeyValuePair<String,String>>

Key value pair collections whose elements will be added as cookies.

options
CookieOptions

CookieOptions included in new cookie settings.

Applies to

ASP.NET Core 9.0 and other versions
Product Versions
ASP.NET Core 6.0, 7.0, 8.0, 9.0

Append(String, String)

Source:
IResponseCookies.cs

Add a new cookie and value.

C#
public void Append (string key, string value);

Parameters

key
String

Name of the new cookie.

value
String

Value of the new cookie.

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

Append(String, String, CookieOptions)

Source:
IResponseCookies.cs

Add a new cookie.

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

Parameters

key
String

Name of the new cookie.

value
String

Value of the new cookie.

options
CookieOptions

CookieOptions included in the new cookie setting.

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