mirror of
https://github.com/scratchfoundation/scratch-www.git
synced 2024-11-26 17:16:11 -05:00
Add cookie setter to jar
This commit is contained in:
parent
d6782e1034
commit
d307b21d3d
1 changed files with 7 additions and 0 deletions
|
@ -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;
|
||||
};
|
||||
|
|
Loading…
Reference in a new issue