Commit Graph

4 Commits

Author SHA1 Message Date
Timothy Flynn
6cbfce87bd LibWeb+LibWebView: Set the default path for invalid cookie Path values
We were missing this spec step when parsing the Path attribute.

(cherry picked from commit e74d2b17620b1d68d66d51a13831ee1657154a1c)
2024-11-24 21:30:22 -05:00
Timothy Flynn
8ada1255c3 LibWeb: Support cookie Max-Age attributes that exceed i64 limits
Attributes have a max value length of 1024. So we theoretically need to
support values in the range -${"9".repeat(1023)} to ${"9".repeat(1024)}.
These obviously do not fit in an i64, so we were previously failing to
parse the attribute.

We will now cap the parsed value to the numeric limits of an i64, after
ensuring that the attribute value is indeed a number.

(cherry picked from commit ba1189cd1c47ab0593e0c3d7eee85e7aafc3462d)
2024-11-24 21:30:22 -05:00
Timothy Flynn
bd845f87a1 LibWeb+LibWebView: Implement the latest cookie draft RFC
We currently implement the official cookie RFC, which was last updated
in 2011. Unfortunately, web reality conflicts with the RFC. For example,
all of the major browsers allow nameless cookies, which the RFC forbids.

There has since been draft versions of the RFC published to address such
issues. This patch implements the latest draft.

Major differences include:
* Allowing nameless or valueless (but not both) cookies
* Formal cookie length limits
* Formal same-site rules (not fully implemented here)
* More rules around cookie domains

(cherry picked from commit fce003a8f581a49d1c6e6472e33b8250052530db)
2024-11-24 17:29:26 -05:00
Timothy Flynn
00510e40d9 LibWeb: Convert the cookie test page to a text test 2024-01-10 23:26:40 +01:00