Interface nsICookieManagerType

An optional interface for accessing or removing the cookies that are in the cookie list

Hierarchy

Methods

  • Increases the reference count for this interface. The associated instance will not be deleted unless the reference count is returned to zero.

    Returns

    The resulting reference count.

    Returns number

  • Parameters

    • aIID: object
    • Optional aInstancePtr: object

    Returns any

  • A run time mechanism for interface discovery.

    Returns

    NS_OK if the interface is supported by the associated instance, NS_NOINTERFACE if it is not.

    aInstancePtr must not be null.

    Parameters

    • aIID: object

      [in] A requested interface IID

    • aInstancePtr: object

      [out] A pointer to an interface pointer to receive the result.

    Returns void

  • Decreases the reference count for this interface. Generally, if the reference count returns to zero, the associated instance is deleted.

    Returns

    The resulting reference count.

    Returns number

  • Add a cookie. nsICookieService is the normal way to do this. This method is something of a backdoor.

    Parameters

    • aHost: string

      the host or domain for which the cookie is set. presence of a leading dot indicates a domain cookie; otherwise, the cookie is treated as a non-domain cookie (see RFC2109). The host string will be normalized to ASCII or ACE; any trailing dot will be stripped. To be a domain cookie, the host must have at least two subdomain parts (e.g. '.foo.com', not '.com'), otherwise an exception will be thrown. An empty string is acceptable (e.g. file:// URI's).

    • aPath: string

      path within the domain for which the cookie is valid

    • aName: string

      cookie name

    • aValue: string

      cookie data

    • aIsSecure: boolean

      true if the cookie should only be sent over a secure connection.

    • aIsHttpOnly: boolean

      true if the cookie should only be sent to, and can only be modified by, an http connection.

    • aIsSession: boolean

      true if the cookie should exist for the current session only. see aExpiry.

    • aExpiry: int64_t

      expiration date, in seconds since midnight (00:00:00), January 1, 1970 UTC. note that expiry time will also be honored for session cookies; in this way, the more restrictive of the two will take effect.

    • aOriginAttributes: any

      the originAttributes of this cookie.

    • aSameSite: int32_t

      the SameSite attribute.

    • aSchemeMap: nsICookie_schemeType

    Returns void

  • Parameters

    • aHost: string
    • aPath: string
    • aName: string
    • aValue: string
    • aIsSecure: boolean
    • aIsHttpOnly: boolean
    • aIsSession: boolean
    • aExpiry: int64_t
    • aOriginAttributes: OriginAttributesPtr
    • aSameSite: int32_t
    • aSchemeMap: nsICookie_schemeType

    Returns number

  • Find whether a given cookie already exists.

    Returns

    true if a cookie was found which matches the host, path, name and originAttributes fields of aCookie

    Parameters

    • aHost: string

      the cookie's host to look for

    • aPath: string

      the cookie's path to look for

    • aName: string

      the cookie's name to look for

    • aOriginAttributes: any

      the cookie's originAttributes to look for

    Returns boolean

  • Parameters

    • aHost: string
    • aPath: string
    • aName: string
    • aOriginAttributes: OriginAttributesPtr
    • aExists: boolean

    Returns number

  • Count how many cookies exist within the base domain of 'aHost'. Thus, for a host "weather.yahoo.com", the base domain would be "yahoo.com", and any host or domain cookies for "yahoo.com" and its subdomains would be counted.

    Add

    for a description of acceptable host strings.

    Returns

    the number of cookies found.

    Parameters

    • aHost: string

      the host string to search for, e.g. "google.com". this should consist of only the host portion of a URI. see

    Returns number

  • Returns current effective value of the cookieBehavior. It will return the different pref according to the aIsPrivate. If aIsPrivate is true, it will return the pref "network.cookie.cookieBehavior". Otherwise, it will return the pref "network.cookie.cookieBehavior.pbmode"

    Parameters

    • aIsPrivate: boolean

    Returns uint32_t

  • Get a specific cookie by host, path, name and OriginAttributes.

    Returns

    cookie matching the arguments or nullptr if not existing.

    Parameters

    • aHost: string

      the cookie's host to look for

    • aPath: string

      the cookie's path to look for

    • aName: string

      the cookie's name to look for

    • aOriginAttributes: OriginAttributesPtr

      the cookie's originAttributes to look for

    • aCookie: nsICookie

    Returns number

  • Called to remove an individual cookie from the cookie list, specified by host, name, and path. If the cookie cannot be found, no exception is thrown. Typically, the arguments to this method will be obtained directly from the desired nsICookie object.

    See

    nsICookieManager::add for a description of acceptable host strings. If the target cookie is a domain cookie, a leading dot must be present.

    Parameters

    • aHost: string

      The host or domain for which the cookie was set.

    • aName: string

      The name specified in the cookie

    • aPath: string

      The path for which the cookie was set

    • aOriginAttributes: any

      The originAttributes of this cookie.

    Returns void

  • Called to remove all cookies from the cookie list

    Returns void

  • Removes all cookies that were created on or after aSinceWhen, and returns a Promise which will be resolved when the last such cookie has been removed.

    Parameters

    • aSinceWhen: int64_t

      the starting point in time after which no cookies should be created when the Promise returned from this method is resolved.

    Returns any

  • Remove all the cookies whose origin attributes matches aPattern and the host is exactly aHost (without subdomain matching).

    Parameters

    • aHost: string

      the host to match

    • aPattern: string

      origin attribute pattern in JSON format

    Returns void

  • Remove all the cookies whose origin attributes matches aPattern

    Parameters

    • aPattern: string

      origin attribute pattern in JSON format

    • aHost: string

    Returns void

  • Parameters

    • aHost: string
    • aName: string
    • aPath: string
    • aOriginAttributes: OriginAttributesPtr

    Returns number

Generated using TypeDoc