apply path explicitly rather than in defaults

This should fix #1455 by preventing the path from being changes via opts passed in, even though we don’t pass in a `path` anywhere.
This commit is contained in:
Matthew Taylor 2017-09-18 11:44:06 -04:00
parent e119cea627
commit 4175c119d2

View file

@ -72,9 +72,9 @@ var Jar = {
},
set: function (name, value, opts) {
defaults(opts, {
expires: new Date(new Date().setYear(new Date().getFullYear() + 1)),
path: '/'
expires: new Date(new Date().setYear(new Date().getFullYear() + 1))
});
opts.path = '/';
var obj = cookie.serialize(name, value, opts);
document.cookie = obj;
},