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.
14 namespace mozilla
::net
{
19 [ref] native const_Cookie
(const mozilla
::net
::Cookie
);
21 typedef long nsCookieStatus
;
22 typedef long nsCookiePolicy
;
24 [builtinclass
, scriptable
, uuid(adf0db5e
-211e
-45a3
-be14
-4486ac430a58
)]
25 interface nsICookie
: nsISupports
{
26 const uint32_t SAMESITE_NONE
= 0;
27 const uint32_t SAMESITE_LAX
= 1;
28 const uint32_t SAMESITE_STRICT
= 2;
31 * the name of the cookie
33 readonly attribute ACString name
;
38 readonly attribute AUTF8String value
;
41 * true if the cookie is a domain cookie, false otherwise
43 readonly attribute
boolean isDomain
;
46 * the host (possibly fully qualified) of the cookie
48 readonly attribute AUTF8String host
;
51 * the host (possibly fully qualified) of the cookie,
52 * without a leading dot to represent if it is a
55 readonly attribute AUTF8String rawHost
;
58 * the path pertaining to the cookie
60 readonly attribute AUTF8String path
;
63 * true if the cookie was transmitted over ssl, false otherwise
65 readonly attribute
boolean isSecure
;
68 * @DEPRECATED use nsICookie.expiry and nsICookie.isSession instead.
70 * expiration time in seconds since midnight (00:00:00), January 1, 1970 UTC.
71 * expires = 0 represents a session cookie.
72 * expires = 1 represents an expiration time earlier than Jan 1, 1970.
74 readonly attribute uint64_t expires
;
77 * the actual expiry time of the cookie, in seconds
78 * since midnight (00:00:00), January 1, 1970 UTC.
80 * this is distinct from nsICookie::expires, which
81 * has different and obsolete semantics.
83 readonly attribute int64_t expiry
;
86 * The origin attributes for this cookie
89 readonly attribute jsval originAttributes
;
91 [noscript
, notxpcom
, nostdcall
, binaryname
(AsCookie
)]
92 const_Cookie AsCookie
();
95 * true if the cookie is a session cookie.
96 * note that expiry time will also be honored
97 * for session cookies (see below); thus, whichever is
98 * the more restrictive of the two will take effect.
100 readonly attribute
boolean isSession
;
103 * true if the cookie is an http only cookie
105 readonly attribute
boolean isHttpOnly
;
108 * the creation time of the cookie, in microseconds
109 * since midnight (00:00:00), January 1, 1970 UTC.
111 readonly attribute int64_t creationTime
;
114 * the last time the cookie was accessed (i.e. created,
115 * modified, or read by the server), in microseconds
116 * since midnight (00:00:00), January 1, 1970 UTC.
118 * note that this time may be approximate.
120 readonly attribute int64_t lastAccessed
;
123 * the SameSite attribute; this controls the cookie behavior for cross-site
125 * https://tools.ietf.org/html/draft-west-first-party-cookies-07
127 * This should be one of:
128 * - SAMESITE_NONE - the SameSite attribute is not present
129 * - SAMESITE_LAX - the SameSite attribute is present, but not strict
130 * - SAMESITE_STRICT - the SameSite attribute is present and strict
132 readonly attribute int32_t sameSite
;
135 * The list of possible schemes of cookies. It's a bitmap because a cookie
136 * can be set on HTTP and HTTPS. At the moment, we treat it as the same
139 cenum schemeType
: 8 {
149 readonly attribute nsICookie_schemeType schemeMap
;