summaryrefslogtreecommitdiff
path: root/Userland/Libraries/LibWeb/Cookie/Cookie.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'Userland/Libraries/LibWeb/Cookie/Cookie.cpp')
-rw-r--r--Userland/Libraries/LibWeb/Cookie/Cookie.cpp11
1 files changed, 6 insertions, 5 deletions
diff --git a/Userland/Libraries/LibWeb/Cookie/Cookie.cpp b/Userland/Libraries/LibWeb/Cookie/Cookie.cpp
index 8d5edfdf83..e24fa7b7d0 100644
--- a/Userland/Libraries/LibWeb/Cookie/Cookie.cpp
+++ b/Userland/Libraries/LibWeb/Cookie/Cookie.cpp
@@ -12,9 +12,10 @@
namespace Web::Cookie {
-static DeprecatedString time_to_string(Duration const& time)
+static DeprecatedString time_to_string(UnixDateTime const& time)
{
- auto local_time = Core::DateTime::from_timestamp(time.to_seconds());
+ // FIXME: This roundabout formatting should not be necessary; it also loses precision.
+ auto local_time = Core::DateTime::from_timestamp(time.seconds_since_epoch());
return local_time.to_deprecated_string("%Y-%m-%d %H:%M:%S %Z"sv);
}
@@ -87,11 +88,11 @@ ErrorOr<Web::Cookie::Cookie> IPC::decode(Decoder& decoder)
auto value = TRY(decoder.decode<DeprecatedString>());
auto domain = TRY(decoder.decode<DeprecatedString>());
auto path = TRY(decoder.decode<DeprecatedString>());
- auto creation_time = TRY(decoder.decode<Duration>());
- auto expiry_time = TRY(decoder.decode<Duration>());
+ auto creation_time = TRY(decoder.decode<UnixDateTime>());
+ auto expiry_time = TRY(decoder.decode<UnixDateTime>());
auto host_only = TRY(decoder.decode<bool>());
auto http_only = TRY(decoder.decode<bool>());
- auto last_access_time = TRY(decoder.decode<Duration>());
+ auto last_access_time = TRY(decoder.decode<UnixDateTime>());
auto persistent = TRY(decoder.decode<bool>());
auto secure = TRY(decoder.decode<bool>());
auto same_site = TRY(decoder.decode<Web::Cookie::SameSite>());