Skip to content

Commit 4cd7df2

Browse files
committed
Make expires attribute handling more concise
1 parent 7441ec7 commit 4cd7df2

File tree

1 file changed

+1
-3
lines changed

1 file changed

+1
-3
lines changed

src/js.cookie.js

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -51,9 +51,7 @@
5151
}, api.defaults, attributes);
5252

5353
if (typeof attributes.expires === 'number') {
54-
var expires = new Date();
55-
expires.setMilliseconds(expires.getMilliseconds() + attributes.expires * 864e+5);
56-
attributes.expires = expires;
54+
attributes.expires = new Date(new Date() * 1 + attributes.expires * 864e+5);
5755
}
5856

5957
// We're using "expires" because "max-age" is not supported by IE

0 commit comments

Comments
 (0)