summaryrefslogtreecommitdiff
path: root/addons/web/static/src/js/framework/session.js
diff options
context:
space:
mode:
authorJérome Maes <jem@openerp.com>2015-03-19 14:08:17 +0100
committerJérome Maes <jem@openerp.com>2015-03-24 11:48:25 +0100
commitebc75e139512ff2f4bf20d2680aa52765c1c9513 (patch)
tree322993d7a9daa3fd1e4c61cd6c3c913775d04ee1 /addons/web/static/src/js/framework/session.js
parent88f119314f9137f52bc6c01b97c85dfbfabf96ca (diff)
[IMP] web : add set_cookie in utils.js (framework) since the get_cookie method already exists. The set_cookie of session.js is now using the one from utils.js
Diffstat (limited to 'addons/web/static/src/js/framework/session.js')
-rw-r--r--addons/web/static/src/js/framework/session.js9
1 files changed, 2 insertions, 7 deletions
diff --git a/addons/web/static/src/js/framework/session.js b/addons/web/static/src/js/framework/session.js
index 4cc9a481b4d..5f6d4c91ea2 100644
--- a/addons/web/static/src/js/framework/session.js
+++ b/addons/web/static/src/js/framework/session.js
@@ -156,12 +156,7 @@ var Session = core.Class.extend(mixins.EventDispatcherMixin, {
set_cookie: function (name, value, ttl) {
if (!this.name) { return; }
ttl = ttl || 24*60*60*365;
- document.cookie = [
- this.name + '|' + name + '=' + encodeURIComponent(JSON.stringify(value)),
- 'path=/',
- 'max-age=' + ttl,
- 'expires=' + new Date(new Date().getTime() + ttl*1000).toGMTString()
- ].join(';');
+ utils.set_cookie(this.name + '|' + name, value, ttl);
},
/**
* Load additional web addons of that instance and init them
@@ -388,7 +383,7 @@ var Session = core.Class.extend(mixins.EventDispatcherMixin, {
qs = "?" + qs;
var prefix = _.any(['http://', 'https://', '//'], function(el) {
return path.length >= el.length && path.slice(0, el.length) === el;
- }) ? '' : this.prefix;
+ }) ? '' : this.prefix;
return prefix + path + qs;
},
});