From 43ab477dd6e102ea1f41f4ae6cf0d24909336d31 Mon Sep 17 00:00:00 2001 From: Farzad Senart Date: Wed, 22 Nov 2017 02:55:45 +0100 Subject: [PATCH] Enable session cookies To set session scoped cookies, one must set the expires parameter to 0. Using hasOwnProperty method allows to overcome the limit of the if statement. Moreover, the current implementation seems to have a tipo, as the check is performed on "expire" and the value is taken from "expires" and the jsdoc advocates "expires". --- src/CookieStorage.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/CookieStorage.js b/src/CookieStorage.js index 731561ac..64b48c3c 100644 --- a/src/CookieStorage.js +++ b/src/CookieStorage.js @@ -19,7 +19,7 @@ export default class CookieStorage { } else { this.path = '/'; } - if (data.expire){ + if (data.hasOwnProperty('expires')){ this.expires = data.expires; } else { this.expires = 365;