diff --git a/src/lib/jar.js b/src/lib/jar.js index d4f509780..250a04608 100644 --- a/src/lib/jar.js +++ b/src/lib/jar.js @@ -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; +};