diff --git a/index.bs b/index.bs index d250db9..898c264 100644 --- a/index.bs +++ b/index.bs @@ -27,8 +27,8 @@ Level: 1
spec: ecma262; urlPrefix: https://tc39.github.io/ecma262/ - type: dfn - text: time values; url: sec-time-values-and-time-range + type: dfn; text: time values; url: sec-time-values-and-time-range + type: dfn; text: ToString; url: sec-tostring
@@ -490,6 +490,7 @@ dictionary CookieInit {
USVString path = "/";
CookieSameSite sameSite = "strict";
boolean partitioned = false;
+ long long? maxAge = null;
};
dictionary CookieStoreDeleteOptions {
@@ -658,8 +659,9 @@ The set(|name|, |value|) method steps are:
null,
null,
"`/`",
- "{{CookieSameSite/strict}}", and
- false.
+ "{{CookieSameSite/strict}}",
+ false, and
+ null.
1. If |r| is failure, then [=reject=] |p| with a {{TypeError}} and abort these steps.
1. [=/Resolve=] |p| with undefined.
1. Return |p|.
@@ -682,8 +684,9 @@ The set(|options|) method steps are:
|options|["{{CookieInit/expires}}"],
|options|["{{CookieInit/domain}}"],
|options|["{{CookieInit/path}}"],
- |options|["{{CookieInit/sameSite}}"], and
- |options|["{{CookieInit/partitioned}}"].
+ |options|["{{CookieInit/sameSite}}"],
+ |options|["{{CookieInit/partitioned}}"], and
+ |options|["{{CookieInit/maxAge}}"].
1. If |r| is failure, then [=reject=] |p| with a {{TypeError}} and abort these steps.
1. [=/Resolve=] |p| with undefined.
1. Return |p|.
@@ -992,15 +995,6 @@ The cookieStore getter steps a
-
-To represent a date and time |dateTime| as a timestamp,
-return the number of milliseconds from 00:00:00 UTC, 1 January 1970 to |dateTime|
-(assuming that there are exactly 86,400,000 milliseconds per day).
-
-Note: This is the same representation used for [=time values=] in [[ECMAScript]].
-
-
-
To date serialize a {{DOMHighResTimeStamp}} |millis|,
let |dateTime| be the date and time |millis| milliseconds after 00:00:00 UTC, 1 January 1970
@@ -1061,8 +1055,9 @@ To set a cookie given a [=/URL=] |url|,
{{DOMHighResTimeStamp}}-or-null |expires|,
[=/scalar value string=]-or-null |domain|,
[=/scalar value string=] |path|,
-[=/string=] |sameSite|, and
-[=/boolean=] |partitioned|:
+[=/string=] |sameSite|,
+[=/boolean=] |partitioned|, and
+[=/64-bit signed integer=]-or-null |maxAge|:
1. [=Normalize=] |name|.
1. [=Normalize=] |value|.
@@ -1090,7 +1085,10 @@ To set a cookie given a [=/URL=] |url|,
1. Let |encodedDomain| be the result of [=UTF-8 encode|UTF-8 encoding=] |parsedDomain|.
1. If the [=byte sequence=] [=byte sequence/length=] of |encodedDomain| is greater than the [=cookie/maximum attribute value size=], then return failure.
1. [=list/Append=] (\``Domain`\`, |encodedDomain|) to |attributes|.
-1. If |expires| is non-null, then [=list/append=] (\``Expires`\`, |expires| ([=date serialized=])) to |attributes|.
+1. If |expires| is non-null:
+ 1. If |maxAge| is non-null, then return failure.
+ 1. [=list/Append=] (\``Expires`\`, |expires| ([=date serialized=])) to |attributes|.
+1. Otherwise, if |maxAge| is non-null, then [=list/append=] (\``Max-Age`\`, [=ToString=](|maxAge|)) to |attributes|.
1. If |path| is the empty string, then set |path| to the [=/serialized cookie default path=] of |url|.
1. If |path| does not start with U+002F (/), then return failure.
1. If |path| is not U+002F (/), and |name|, [=byte-lowercased=], [=byte sequence/starts with=] \``__host-`\`, then return failure.
@@ -1107,7 +1105,7 @@ To set a cookie given a [=/URL=] |url|,
: "{{CookieSameSite/lax}}"
:: [=list/Append=] (\``SameSite`\`, \``Lax`\`) to |attributes|.
-1. If |partitioned| is true, [=list/Append=] (``Partitioned`\`, \`\`) to |attributes|.
+1. If |partitioned| is true, [=list/Append=] (\``Partitioned`\`, \`\`) to |attributes|.
1. Perform the steps defined in [[RFC6265BIS-14#name-storage-model|Cookies ยง Storage Model]] for when the user agent "receives a cookie" with
|url| as request-uri,
|encodedName| as cookie-name,
@@ -1136,26 +1134,19 @@ a [=/URL=] |url|,
[=/scalar value string=] |path|, and
[=/boolean=] |partitioned|:
-1. Let |expires| be the earliest representable date represented [=as a timestamp=].
-
- Note: The exact value of |expires| is not important for the purposes of this algorithm,
- as long as it is in the past.
-
1. [=Normalize=] |name|.
-
1. Let |value| be the empty string.
-
1. If |name|'s [=string/length=] is 0, then set |value| to any non-empty [=implementation-defined=] string.
-
1. Return the results of running [=set a cookie=] with
|url|,
|name|,
|value|,
- |expires|,
+ null,
|domain|,
|path|,
- "{{CookieSameSite/strict}}", and
- |partitioned|.
+ "{{CookieSameSite/strict}}",
+ |partitioned|,
+ and 0.