From afa7151e6ab488ff0cbf9907ed08091e8993de97 Mon Sep 17 00:00:00 2001 From: jkhsjdhjs Date: Sat, 17 Aug 2019 05:15:16 +0200 Subject: [PATCH] fix Cookie.hasExpired() for session cookies --- src/cookie.mjs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/cookie.mjs b/src/cookie.mjs index dc8e396..476b249 100644 --- a/src/cookie.mjs +++ b/src/cookie.mjs @@ -112,7 +112,7 @@ export default class Cookie { return this.name + "=" + this.value; } hasExpired(sessionEnded) { - return sessionEnded && this.expiry === null || this.expiry < new Date(); + return sessionEnded && this.expiry === null || this.expiry && this.expiry < new Date(); } isValidForRequest(requestURL) { if(this.hasExpired(false))