Interface ICookieManager
Defines cookie related operations.
Namespace: Umbraco.Cms.Core.Web
Assembly: Umbraco.Core.dll
Syntax
public interface ICookieManager
Methods
View SourceExpireCookie(String)
Expires the cookie with the specified name.
Declaration
void ExpireCookie(string cookieName)
Parameters
Type | Name | Description |
---|---|---|
System. |
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. |
cookieName | The cookie name. |
Returns
Type | Description |
---|---|
System. |
HasCookie(String)
Determines whether a cookie with the specified name exists.
Declaration
bool HasCookie(string cookieName)
Parameters
Type | Name | Description |
---|---|---|
System. |
cookieName | The cookie name. |
Returns
Type | Description |
---|---|
System. |
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. |
cookieName | The cookie name. |
System. |
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. |
cookieName | The cookie name. |
System. |
value | The cookie value. |
System. |
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. |
cookieName | The cookie name. |
System. |
value | The cookie value. |
System. |
httpOnly | Indicates whether the created cookie should be marked as HTTP only. |
System. |
secure | Indicates whether the created cookie should be marked as secure. |
System. |
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.