Merge pull request from mewtaylor/issue/gh-1455

GH-1455: apply path explicitly rather than in `defaults`
This commit is contained in:
Matthew Taylor 2017-09-19 17:14:00 -04:00 committed by GitHub
commit 129042fce6

View file

@ -71,10 +71,11 @@ var Jar = {
});
},
set: function (name, value, opts) {
opts = 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;
},