f60f61a3 by Adam Heath

Switch from $.cookie to js-cookie.

1 parent 21af861a
......@@ -3,6 +3,7 @@
"version": "2016.12.01-0",
"main": "src/scripts/Auth.js",
"dependencies": {
"js-cookie": "",
"backbone": "",
"requirejs": ""
},
......
......@@ -3,6 +3,7 @@ define(function(require) {
var $ = require('jquery');
var _ = require('underscore');
var Backbone = require('backbone');
var cookie = require('js-cookie');
function bindMethods() {
var args = _.toArray(arguments);
......@@ -156,16 +157,16 @@ define(function(require) {
}
var sessionId = self.get('sessionId');
if (sessionId) {
$.cookie(cookieName, sessionId);
cookie.set(cookieName, sessionId);
} else {
self.set('sessionId', $.cookie(cookieName));
self.set('sessionId', cookie.get(cookieName));
}
self.on('change:sessionId', function() {
var sessionId = this.get('sessionId');
if (sessionId) {
$.cookie(cookieName, sessionId);
cookie.set(cookieName, sessionId);
} else {
$.removeCookie(cookieName);
cookie.remove(cookieName);
}
}, self);
})(this, globalOptions.cookieName);
......