Skip to content

Commit 5abe7bd

Browse files
authored
Merge pull request #831 from lightpanda-io/log_invalid_cookie_expiry
use logger for invalid cookie expiry
2 parents 54be651 + 92654fc commit 5abe7bd

File tree

1 file changed

+6
-1
lines changed

1 file changed

+6
-1
lines changed

src/browser/storage/cookie.zig

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -296,7 +296,12 @@ pub const Cookie = struct {
296296
}
297297
if (exp_dt) |dt| {
298298
normalized_expires = @floatFromInt(dt.unix(.seconds));
299-
} else std.debug.print("Invalid cookie expires value: {s}\n", .{expires_});
299+
} else {
300+
// Algolia, for example, will call document.setCookie with
301+
// an expired value which is literally 'Invalid Date'
302+
// (it's trying to do something like: `new Date() + undefined`).
303+
log.debug(.web_api, "cookie expires date", .{ .date = expires_ });
304+
}
300305
}
301306
}
302307

0 commit comments

Comments
 (0)