summaryrefslogtreecommitdiff
path: root/addons/web/static/src/js/corelib.js
diff options
context:
space:
mode:
authorniv-openerp <nicolas.vanhoren@openerp.com>2013-07-11 18:03:57 +0200
committerniv-openerp <nicolas.vanhoren@openerp.com>2013-07-11 18:03:57 +0200
commite9981f2d7c4223ee0a6d6426c4c420ea3613697a (patch)
treebbdae254f57c1d0aabe7cac6deaba2e2e954961e /addons/web/static/src/js/corelib.js
parentee6f6e45db723fa0384586b7b2abb17090e93283 (diff)
parenta0a05454aa2e04c7b66425c40c3812890fc35458 (diff)
[IMP] Important changes to the OpenERPSession server-side class and the way the web client handles sessions. Mostly:
* The OpenERPSession class now extends the werkzeug's session class, and is now the only class used to handle sessions * Now only one cookie is used to identify the session: session_id . It is also possible to specify the id by adding the http parameter session_id (the http parameter has higher priority than the cookie). bzr revid: nicolas.vanhoren@openerp.com-20130711160357-38tb26zf5dfp1jlv
Diffstat (limited to 'addons/web/static/src/js/corelib.js')
-rw-r--r--addons/web/static/src/js/corelib.js15
1 files changed, 5 insertions, 10 deletions
diff --git a/addons/web/static/src/js/corelib.js b/addons/web/static/src/js/corelib.js
index 116ddf2e8c2..007a0adc803 100644
--- a/addons/web/static/src/js/corelib.js
+++ b/addons/web/static/src/js/corelib.js
@@ -1000,8 +1000,6 @@ instance.web.JsonRPC = instance.web.Class.extend(instance.web.PropertiesMixin, {
context: this.user_context || {}
});
// Construct a JSON-RPC2 request, method is currently unused
- if (this.debug)
- params.debug = 1;
var payload = {
jsonrpc: '2.0',
method: 'call',
@@ -1011,7 +1009,8 @@ instance.web.JsonRPC = instance.web.Class.extend(instance.web.PropertiesMixin, {
var deferred = $.Deferred();
if (! options.shadow)
this.trigger('request', url, payload);
-
+ payload.debug = this.debug ? true : false;
+
this.rpc_function(url, payload).then(
function (response, textStatus, jqXHR) {
if (! options.shadow)
@@ -1068,13 +1067,12 @@ instance.web.JsonRPC = instance.web.Class.extend(instance.web.PropertiesMixin, {
var data = {
session_id: this.session_id,
id: payload.id,
- sid: this.httpsessionid,
};
var set_sid = function (response, textStatus, jqXHR) {
// If response give us the http session id, we store it for next requests...
- if (response.httpsessionid) {
- self.httpsessionid = response.httpsessionid;
+ if (response.session_id) {
+ self.session_id = response.session_id;
}
};
@@ -1090,7 +1088,7 @@ instance.web.JsonRPC = instance.web.Class.extend(instance.web.PropertiesMixin, {
ajax.async = false;
var payload_str = JSON.stringify(payload);
var payload_url = $.param({r:payload_str});
- if(payload_url.length < 2000) {
+ if (payload_url.length < 2000) {
// Direct jsonp request
ajax.data.r = payload_str;
return $.ajax(ajax).done(set_sid);
@@ -1139,9 +1137,6 @@ instance.web.JsonRPC = instance.web.Class.extend(instance.web.PropertiesMixin, {
var qs = '';
if (!_.isNull(params)) {
params = _.extend(params || {}, {session_id: this.session_id});
- if (this.httpsessionid) {
- params.sid = this.httpsessionid;
- }
qs = '?' + $.param(params);
}
var prefix = _.any(['http://', 'https://', '//'], _.bind(_.str.startsWith, null, path)) ? '' : this.prefix;