Commit 9cd5c980 authored by Ray Schamp's avatar Ray Schamp

Make Jar formatting consistent with everything else

parent 3c307e17
......@@ -9,9 +9,8 @@ var xhr = require('xhr');
* set(name, value) – synchronously sets the cookie
* use(name, uri, callback) – can by sync or async, gets cookie from the uri if not there.
*/
var Jar = {};
Jar.get = function (name, callback) {
var Jar = {
get: function (name, callback) {
// Get cookie by name
var obj = cookie.parse(document.cookie) || {};
......@@ -22,9 +21,8 @@ Jar.get = function (name, callback) {
}
return obj[name];
};
Jar.use = function (name, uri, callback) {
},
use: function (name, uri, callback) {
// Attempt to get cookie
Jar.get(name, function (err, obj) {
if (typeof obj !== 'undefined') return callback(null, obj);
......@@ -37,13 +35,13 @@ Jar.use = function (name, uri, callback) {
Jar.get(name, callback);
});
});
};
Jar.set = function (name, value) {
},
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;
}
};
module.exports = Jar;
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment