Search Results for

    Show / Hide Table of Contents
    View Source

    Interface ICookieManager

    Defines cookie related operations.

    Namespace: Umbraco.Cms.Core.Web
    Assembly: Umbraco.Core.dll
    Syntax
    public interface ICookieManager

    Methods

    View Source

    ExpireCookie(String)

    Expires the cookie with the specified name.

    Declaration
    void ExpireCookie(string cookieName)
    Parameters
    Type Name Description
    System.String cookieName

    The cookie name.

    View Source

    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
    View Source

    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
    View Source

    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.

    View Source

    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.

    View Source

    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.

    • Improve this Doc
    • View Source
    In This Article
    • Methods
      • ExpireCookie(String)
      • GetCookieValue(String)
      • HasCookie(String)
      • SetCookieValue(String, String)
      • SetCookieValue(String, String, Boolean)
      • SetCookieValue(String, String, Boolean, Boolean, String)
    Back to top Copyright © 2016-present Umbraco
    Generated by DocFX