From 416c4afba63887a7f7a2d452c755666fee805856 Mon Sep 17 00:00:00 2001 From: Nabi KaramAliZadeh Date: Thu, 8 Feb 2024 22:54:43 +0330 Subject: [PATCH] Cookies without an expiration date are also saved --- src/cookie-jar.mjs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/cookie-jar.mjs b/src/cookie-jar.mjs index ea0aeda..800a7a1 100644 --- a/src/cookie-jar.mjs +++ b/src/cookie-jar.mjs @@ -67,7 +67,7 @@ export default class CookieJar { } *cookiesValid(withSession) { for (const cookie of this.cookiesAll()) - if (!cookie.hasExpired(!withSession)) yield cookie; + if (!cookie.hasExpired(!withSession) || cookie.expiry === null) yield cookie; } *cookiesAll() { for (const domain of this.domains()) yield* this.cookiesDomain(domain);