Method SetCookie
SetCookie(Cookie)
Sets a cookie and sends it in the response to be set by the client.
public void SetCookie(Cookie cookie)
Parameters
cookieCookieThe cookie object.
SetCookie(string, string)
Sets a cookie and sends it in the response to be set by the client.
public void SetCookie(string name, string value)
Parameters
SetCookie(string, string, DateTime?, TimeSpan?, string?, string?, bool?, bool?, string?)
Sets a cookie and sends it in the response to be set by the client.
public void SetCookie(string name, string value, DateTime? expires = null, TimeSpan? maxAge = null, string? domain = null, string? path = null, bool? secure = null, bool? httpOnly = null, string? sameSite = null)
Parameters
namestringThe cookie name.
valuestringThe cookie value.
expiresDateTime?The cookie expirity date.
maxAgeTimeSpan?The cookie max duration after being set.
domainstringThe domain where the cookie will be valid.
pathstringThe path where the cookie will be valid.
securebool?Determines if the cookie will only be stored in an secure context.
httpOnlybool?Determines if the cookie will be only available in the HTTP context.
sameSitestringThe cookie SameSite parameter.
English
Русский
Português
Español
Deutsch
中文 (简体)
日本語