From 53018d93d4211988c8092622b61fb4c5f610d7d1 Mon Sep 17 00:00:00 2001 From: Euclid Ye Date: Thu, 26 Mar 2026 21:21:51 +0800 Subject: [PATCH 1/2] Throw "invalid cookie domain" instead Signed-off-by: Euclid Ye --- index.html | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/index.html b/index.html index 4ad304fe..5f8ca390 100644 --- a/index.html +++ b/index.html @@ -7605,13 +7605,13 @@

Add Cookie

  • If session's current browsing context's document element is - a cookie-averse Document object, + a cookie-averse Document object or + cookie domain is not equal to session's current + browsing context's active document's domain, return error with error code invalid cookie domain.

  • If cookie name or cookie value is null, - cookie domain is not equal to session's current - browsing context's active document's domain, cookie secure only or cookie HTTP only are not boolean types, or cookie expiry time is not an integer type, or it less than 0 or greater than the maximum safe integer, return error with error From 555772ea3bf6ac55a9ae7ec3b89aa58c2d2ad9ef Mon Sep 17 00:00:00 2001 From: Euclid Ye Date: Wed, 1 Apr 2026 11:56:38 +0800 Subject: [PATCH 2/2] Move type check earlier Signed-off-by: Euclid Ye --- index.html | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/index.html b/index.html index 5f8ca390..f45ac8b4 100644 --- a/index.html +++ b/index.html @@ -7603,6 +7603,12 @@

    Add Cookie

  • Try to handle any user prompts with session. +

  • If cookie name or cookie value is null, + cookie secure only or cookie HTTP only are not boolean types, + or cookie expiry time is not an integer type, or it less than 0 or greater than + the maximum safe integer, return error with error + code invalid argument. +

  • If session's current browsing context's document element is a cookie-averse Document object or @@ -7611,12 +7617,6 @@

    Add Cookie

    return error with error code invalid cookie domain. -
  • If cookie name or cookie value is null, - cookie secure only or cookie HTTP only are not boolean types, - or cookie expiry time is not an integer type, or it less than 0 or greater than - the maximum safe integer, return error with error - code invalid argument. -

  • Create a cookie in the cookie store associated with the active document's address