Bug 1807268 - Re-enable verifyShowClipboardSuggestionsToggleTest UI test r=jajohnson
[gecko.git] / netwerk / cookie / nsICookie.idl
blob6d7fedfd210d6b2b81785c5c9e2ff8ce094491bb
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"
9 /**
10 * Main cookie object interface.
13 %{C++
14 namespace mozilla {
15 class OriginAttributes;
17 namespace net {
18 class Cookie;
23 [ref] native const_OriginAttributes(const mozilla::OriginAttributes);
24 [ref] native const_Cookie(const mozilla::net::Cookie);
26 typedef long nsCookieStatus;
27 typedef long nsCookiePolicy;
29 [builtinclass, scriptable, uuid(adf0db5e-211e-45a3-be14-4486ac430a58)]
30 interface nsICookie : nsISupports {
31 const uint32_t SAMESITE_NONE = 0;
32 const uint32_t SAMESITE_LAX = 1;
33 const uint32_t SAMESITE_STRICT = 2;
35 /**
36 * the name of the cookie
38 readonly attribute ACString name;
40 /**
41 * the cookie value
43 readonly attribute AUTF8String value;
45 /**
46 * true if the cookie is a domain cookie, false otherwise
48 readonly attribute boolean isDomain;
50 /**
51 * the host (possibly fully qualified) of the cookie
53 readonly attribute AUTF8String host;
55 /**
56 * the host (possibly fully qualified) of the cookie,
57 * without a leading dot to represent if it is a
58 * domain cookie.
60 readonly attribute AUTF8String rawHost;
62 /**
63 * the path pertaining to the cookie
65 readonly attribute AUTF8String path;
67 /**
68 * true if the cookie was transmitted over ssl, false otherwise
70 readonly attribute boolean isSecure;
72 /**
73 * @DEPRECATED use nsICookie.expiry and nsICookie.isSession instead.
75 * expiration time in seconds since midnight (00:00:00), January 1, 1970 UTC.
76 * expires = 0 represents a session cookie.
77 * expires = 1 represents an expiration time earlier than Jan 1, 1970.
79 readonly attribute uint64_t expires;
81 /**
82 * the actual expiry time of the cookie, in seconds
83 * since midnight (00:00:00), January 1, 1970 UTC.
85 * this is distinct from nsICookie::expires, which
86 * has different and obsolete semantics.
88 readonly attribute int64_t expiry;
90 /**
91 * The origin attributes for this cookie
93 [implicit_jscontext]
94 readonly attribute jsval originAttributes;
96 /**
97 * Native getter for origin attributes
99 [noscript, notxpcom, nostdcall, binaryname(OriginAttributesNative)]
100 const_OriginAttributes OriginAttributesNative();
102 [noscript, notxpcom, nostdcall, binaryname(AsCookie)]
103 const_Cookie AsCookie();
106 * true if the cookie is a session cookie.
107 * note that expiry time will also be honored
108 * for session cookies (see below); thus, whichever is
109 * the more restrictive of the two will take effect.
111 readonly attribute boolean isSession;
114 * true if the cookie is an http only cookie
116 readonly attribute boolean isHttpOnly;
119 * the creation time of the cookie, in microseconds
120 * since midnight (00:00:00), January 1, 1970 UTC.
122 readonly attribute int64_t creationTime;
125 * the last time the cookie was accessed (i.e. created,
126 * modified, or read by the server), in microseconds
127 * since midnight (00:00:00), January 1, 1970 UTC.
129 * note that this time may be approximate.
131 readonly attribute int64_t lastAccessed;
134 * the SameSite attribute; this controls the cookie behavior for cross-site
135 * requests as per
136 * https://tools.ietf.org/html/draft-west-first-party-cookies-07
138 * This should be one of:
139 * - SAMESITE_NONE - the SameSite attribute is not present
140 * - SAMESITE_LAX - the SameSite attribute is present, but not strict
141 * - SAMESITE_STRICT - the SameSite attribute is present and strict
143 readonly attribute int32_t sameSite;
146 * The list of possible schemes of cookies. It's a bitmap because a cookie
147 * can be set on HTTP and HTTPS. At the moment, we treat it as the same
148 * cookie.
150 cenum schemeType : 8 {
151 SCHEME_UNSET = 0x00,
152 SCHEME_HTTP = 0x01,
153 SCHEME_HTTPS = 0x02,
154 SCHEME_FILE = 0x04,
158 * Bitmap of schemes.
160 readonly attribute nsICookie_schemeType schemeMap;
163 * true if the cookie's OriginAttributes PartitionKey is NOT empty
165 readonly attribute boolean isPartitioned;