Add cookie setter to jar

This commit is contained in:
Matthew Taylor 2015-10-16 10:59:55 -04:00
parent d6782e1034
commit d307b21d3d

View file

@ -30,3 +30,10 @@ module.use = function (name, uri, callback) {
});
});
};
module.set = function (name, value) {
var obj = cookie.serialize(name, value);
var expires = '; expires=' + new Date(new Date().setYear(new Date().getFullYear() + 1)).toUTCString();
var path = '; path=/';
document.cookie = obj + expires + path;
};