Cookies with expiry time set to epoch zero are matched and not expired (original) (raw)

If the server sends a cookie with expiry time set to epoch zero (1970-01-01T00:00:00.000Z), the cookie is then returned in getCookies(url) even though "expire" is set to true (the default)

This is because expiryTime here should be checked for undefined not just !expiryTime

tough-cookie/lib/cookie/cookieJar.ts

Line 940 in1a71340

if (expireCheck && expiryTime && expiryTime <= now) {