Bug 1735777 [wpt PR 31236] - webrtc wpt: fix invalid unicode indexOf method call...
[gecko.git] / netwerk / cookie / nsICookie.idl
blob0b2e5e97bc9d92c076f868534c38e7102cf09950
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 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;
22 /**
23 * the name of the cookie
25 readonly attribute ACString name;
27 /**
28 * the cookie value
30 readonly attribute AUTF8String value;
32 /**
33 * true if the cookie is a domain cookie, false otherwise
35 readonly attribute boolean isDomain;
37 /**
38 * the host (possibly fully qualified) of the cookie
40 readonly attribute AUTF8String host;
42 /**
43 * the host (possibly fully qualified) of the cookie,
44 * without a leading dot to represent if it is a
45 * domain cookie.
47 readonly attribute AUTF8String rawHost;
49 /**
50 * the path pertaining to the cookie
52 readonly attribute AUTF8String path;
54 /**
55 * true if the cookie was transmitted over ssl, false otherwise
57 readonly attribute boolean isSecure;
59 /**
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;
68 /**
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;
77 /**
78 * The origin attributes for this cookie
80 [implicit_jscontext]
81 readonly attribute jsval originAttributes;
83 /**
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;
91 /**
92 * true if the cookie is an http only cookie
94 readonly attribute boolean isHttpOnly;
96 /**
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
113 * requests as per
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
126 * cookie.
128 cenum schemeType : 8 {
129 SCHEME_UNSET = 0x00,
130 SCHEME_HTTP = 0x01,
131 SCHEME_HTTPS = 0x02,
132 SCHEME_FILE = 0x04,
136 * Bitmap of schemes.
138 readonly attribute nsICookie_schemeType schemeMap;