1 /* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*-
3 * This Source Code Form is subject to the terms of the Mozilla Public
4 * License, v. 2.0. If a copy of the MPL was not distributed with this
5 * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
7 #include
"nsISupports.idl"
10 * Main cookie object interface.
13 typedef long nsCookieStatus
;
14 typedef long nsCookiePolicy
;
16 [builtinclass
, scriptable
, uuid(adf0db5e
-211e
-45a3
-be14
-4486ac430a58
)]
17 interface nsICookie
: nsISupports
{
18 const uint32_t SAMESITE_NONE
= 0;
19 const uint32_t SAMESITE_LAX
= 1;
20 const uint32_t SAMESITE_STRICT
= 2;
23 * the name of the cookie
25 readonly attribute ACString name
;
30 readonly attribute AUTF8String value
;
33 * true if the cookie is a domain cookie, false otherwise
35 readonly attribute
boolean isDomain
;
38 * the host (possibly fully qualified) of the cookie
40 readonly attribute AUTF8String host
;
43 * the host (possibly fully qualified) of the cookie,
44 * without a leading dot to represent if it is a
47 readonly attribute AUTF8String rawHost
;
50 * the path pertaining to the cookie
52 readonly attribute AUTF8String path
;
55 * true if the cookie was transmitted over ssl, false otherwise
57 readonly attribute
boolean isSecure
;
60 * @DEPRECATED use nsICookie.expiry and nsICookie.isSession instead.
62 * expiration time in seconds since midnight (00:00:00), January 1, 1970 UTC.
63 * expires = 0 represents a session cookie.
64 * expires = 1 represents an expiration time earlier than Jan 1, 1970.
66 readonly attribute uint64_t expires
;
69 * the actual expiry time of the cookie, in seconds
70 * since midnight (00:00:00), January 1, 1970 UTC.
72 * this is distinct from nsICookie::expires, which
73 * has different and obsolete semantics.
75 readonly attribute int64_t expiry
;
78 * The origin attributes for this cookie
81 readonly attribute jsval originAttributes
;
84 * true if the cookie is a session cookie.
85 * note that expiry time will also be honored
86 * for session cookies (see below); thus, whichever is
87 * the more restrictive of the two will take effect.
89 readonly attribute
boolean isSession
;
92 * true if the cookie is an http only cookie
94 readonly attribute
boolean isHttpOnly
;
97 * the creation time of the cookie, in microseconds
98 * since midnight (00:00:00), January 1, 1970 UTC.
100 readonly attribute int64_t creationTime
;
103 * the last time the cookie was accessed (i.e. created,
104 * modified, or read by the server), in microseconds
105 * since midnight (00:00:00), January 1, 1970 UTC.
107 * note that this time may be approximate.
109 readonly attribute int64_t lastAccessed
;
112 * the SameSite attribute; this controls the cookie behavior for cross-site
114 * https://tools.ietf.org/html/draft-west-first-party-cookies-07
116 * This should be one of:
117 * - SAMESITE_NONE - the SameSite attribute is not present
118 * - SAMESITE_LAX - the SameSite attribute is present, but not strict
119 * - SAMESITE_STRICT - the SameSite attribute is present and strict
121 readonly attribute int32_t sameSite
;
124 * The list of possible schemes of cookies. It's a bitmap because a cookie
125 * can be set on HTTP and HTTPS. At the moment, we treat it as the same
128 cenum schemeType
: 8 {
138 readonly attribute nsICookie_schemeType schemeMap
;