Interface ICookieManager
Defines cookie related operations.
Namespace: Umbraco.Cms.Core.Web
Assembly: Umbraco.Core.dll
Syntax
public interface ICookieManagerMethods
View SourceExpireCookie(String)
Expires the cookie with the specified name.
Declaration
void ExpireCookie(string cookieName)Parameters
| Type | Name | Description | 
|---|---|---|
| System.String | cookieName | The cookie name. | 
GetCookieValue(String)
Gets the value of the cookie with the specified name.
Declaration
string GetCookieValue(string cookieName)Parameters
| Type | Name | Description | 
|---|---|---|
| System.String | cookieName | The cookie name. | 
Returns
| Type | Description | 
|---|---|
| System.String | 
HasCookie(String)
Determines whether a cookie with the specified name exists.
Declaration
bool HasCookie(string cookieName)Parameters
| Type | Name | Description | 
|---|---|---|
| System.String | cookieName | The cookie name. | 
Returns
| Type | Description | 
|---|---|
| System.Boolean | 
SetCookieValue(String, String)
Sets the value of a cookie with the specified name.
Declaration
virtual void SetCookieValue(string cookieName, string value)Parameters
| Type | Name | Description | 
|---|---|---|
| System.String | cookieName | The cookie name. | 
| System.String | value | The cookie value. | 
SetCookieValue(String, String, Boolean)
Sets the value of a cookie with the specified name.
Declaration
void SetCookieValue(string cookieName, string value, bool httpOnly)Parameters
| Type | Name | Description | 
|---|---|---|
| System.String | cookieName | The cookie name. | 
| System.String | value | The cookie value. | 
| System.Boolean | httpOnly | Indicates whether the created cookie should be marked as HTTP only. | 
SetCookieValue(String, String, Boolean, Boolean, String)
Sets the value of a cookie with the specified name.
Declaration
virtual void SetCookieValue(string cookieName, string value, bool httpOnly, bool secure, string sameSiteMode)Parameters
| Type | Name | Description | 
|---|---|---|
| System.String | cookieName | The cookie name. | 
| System.String | value | The cookie value. | 
| System.Boolean | httpOnly | Indicates whether the created cookie should be marked as HTTP only. | 
| System.Boolean | secure | Indicates whether the created cookie should be marked as secure. | 
| System.String | sameSiteMode | Indicates the created cookie's same site status. | 
Remarks
The value provided by sameSiteMode should match the enum values available from
Microsoft.AspNetCore.Http.SameSiteMode.
This hasn't been used as the parameter directly to avoid a dependency on Microsoft.AspNetCore.Http in
the core project.