Early Preview

This is currently very much a preview. Please feel free to try things out, but don't be upset if anything is not yet working. Feedback is welcome over on our GitHub Dicussions page.

interface Microsoft.​AspNetCore.​Http.​IResponseCookies

Assembly: Microsoft.AspNetCore.Http.Features

A wrapper for the response Set-Cookie header.

Methods

void
Append​(string key, string value)
Add a new cookie and value.
key Name of the new cookie.
value Value of the new cookie.
void
Append​(string key, string value, CookieOptions options)
Add a new cookie.
key Name of the new cookie.
value Value of the new cookie.
options <see cref="T:Microsoft.AspNetCore.Http.CookieOptions" /> included in the new cookie setting.
void
Append​(System.​ReadOnlySpan<​System.​Collections.​Generic.​KeyValuePair<​string, string>> keyValuePairs, CookieOptions options)
Add elements of specified collection as cookies.
keyValuePairs Key value pair collections whose elements will be added as cookies.
options <see cref="T:Microsoft.AspNetCore.Http.CookieOptions" /> included in new cookie settings.
void
Delete​(string key)
Sets an expired cookie.
key Name of the cookie to expire.
void
Delete​(string key, CookieOptions options)
Sets an expired cookie.
key Name of the cookie to expire.
options <see cref="T:Microsoft.AspNetCore.Http.CookieOptions" /> used to discriminate the particular cookie to expire. The <see cref="P:Microsoft.AspNetCore.Http.CookieOptions.Domain" /> and <see cref="P:Microsoft.AspNetCore.Http.CookieOptions.Path" /> values are especially important.