Skip to content

Commit 92654fc

Browse files
committed
use logger for invalid cookie expiry
1 parent f5a58c1 commit 92654fc

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)