Bug 1851322 [wpt PR 41781] - HTML: "gopher" is no longer a special scheme, a=testonly
[gecko.git] / netwerk / cookie / nsICookie.idl
blob1ecb4a937f8c8270cc65cf7924f9fc427a6f77d4
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::net {
15 class Cookie;
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;
30 /**
31 * the name of the cookie
33 readonly attribute ACString name;
35 /**
36 * the cookie value
38 readonly attribute AUTF8String value;
40 /**
41 * true if the cookie is a domain cookie, false otherwise
43 readonly attribute boolean isDomain;
45 /**
46 * the host (possibly fully qualified) of the cookie
48 readonly attribute AUTF8String host;
50 /**
51 * the host (possibly fully qualified) of the cookie,
52 * without a leading dot to represent if it is a
53 * domain cookie.
55 readonly attribute AUTF8String rawHost;
57 /**
58 * the path pertaining to the cookie
60 readonly attribute AUTF8String path;
62 /**
63 * true if the cookie was transmitted over ssl, false otherwise
65 readonly attribute boolean isSecure;
67 /**
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;
76 /**
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;
85 /**
86 * The origin attributes for this cookie
88 [implicit_jscontext]
89 readonly attribute jsval originAttributes;
91 [noscript, notxpcom, nostdcall, binaryname(AsCookie)]
92 const_Cookie AsCookie();
94 /**
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
124 * requests as per
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
137 * cookie.
139 cenum schemeType : 8 {
140 SCHEME_UNSET = 0x00,
141 SCHEME_HTTP = 0x01,
142 SCHEME_HTTPS = 0x02,
143 SCHEME_FILE = 0x04,
147 * Bitmap of schemes.
149 readonly attribute nsICookie_schemeType schemeMap;