Optional
aInstancePtr: objectA run time mechanism for interface discovery.
NS_OK if the interface is supported by the associated instance, NS_NOINTERFACE if it is not.
aInstancePtr must not be null.
[in] A requested interface IID
[out] A pointer to an interface pointer to receive the result.
Add a cookie. nsICookieService is the normal way to do this. This method is something of a backdoor.
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).
path within the domain for which the cookie is valid
cookie name
cookie data
true if the cookie should only be sent over a secure connection.
true if the cookie should only be sent to, and can only be modified by, an http connection.
true if the cookie should exist for the current session only. see aExpiry.
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.
the originAttributes of this cookie.
the SameSite attribute.
Find whether a given cookie already exists.
true if a cookie was found which matches the host, path, name and originAttributes fields of aCookie
the cookie's host to look for
the cookie's path to look for
the cookie's name to look for
the cookie's originAttributes to look for
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.
for a description of acceptable host strings.
the number of cookies found.
the host string to search for, e.g. "google.com". this should consist of only the host portion of a URI. see
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"
Get a specific cookie by host, path, name and OriginAttributes.
cookie matching the arguments or nullptr if not existing.
the cookie's host to look for
the cookie's path to look for
the cookie's name to look for
the cookie's originAttributes to look for
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.
nsICookieManager::add for a description of acceptable host strings. If the target cookie is a domain cookie, a leading dot must be present.
The host or domain for which the cookie was set.
The name specified in the cookie
The path for which the cookie was set
The originAttributes of this cookie.
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.
the starting point in time after which no cookies should be created when the Promise returned from this method is resolved.
Remove all the cookies whose origin attributes matches aPattern and the host is exactly aHost (without subdomain matching).
the host to match
origin attribute pattern in JSON format
Generated using TypeDoc
An optional interface for accessing or removing the cookies that are in the cookie list