From d363ed8872338fbce6ea81923e57b137e85b07ea Mon Sep 17 00:00:00 2001 From: Timothy Flynn Date: Mon, 12 Apr 2021 12:15:57 -0400 Subject: [PATCH] Browser: Change value of "the latest representable date" for cookies Setting the year to NumericLimits::max() resulted in the following datetime: -2-12-31 00:00:00. Instead, set the latest datetime to the last second of the year 9999. --- Userland/Applications/Browser/CookieJar.cpp | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/Userland/Applications/Browser/CookieJar.cpp b/Userland/Applications/Browser/CookieJar.cpp index be7fbcdae1..9ddbc9fce9 100644 --- a/Userland/Applications/Browser/CookieJar.cpp +++ b/Userland/Applications/Browser/CookieJar.cpp @@ -26,7 +26,6 @@ #include "CookieJar.h" #include -#include #include #include #include @@ -180,7 +179,7 @@ Optional CookieJar::parse_cookie(const String& cookie_string, String def // 6. The cookie-name is the name string, and the cookie-value is the value string. Cookie cookie { name, value }; - cookie.expiry_time = Core::DateTime::create(AK::NumericLimits::max()); + cookie.expiry_time = Core::DateTime::create(9999, 12, 31, 23, 59, 59); cookie.domain = move(default_domain); cookie.path = move(default_path);