[MERGE] forward port of branch saas-2 up to revid 3906 chs@openerp.com-20140402083506-w4cywcf0kxxx9xmk

bzr revid: chs@openerp.com-20140402092310-ixv8m1z53j107024
This commit is contained in:
Christophe Simonis 2014-04-02 11:23:10 +02:00
commit de117cd8ec
1 changed files with 6 additions and 1 deletions

View File

@ -271,7 +271,12 @@ instance.web.Session.include( /** @lends instance.web.Session# */{
for(var i=0; i<cookies.length; ++i) {
var cookie = cookies[i].replace(/^\s*/, '');
if(cookie.indexOf(nameEQ) === 0) {
return JSON.parse(decodeURIComponent(cookie.substring(nameEQ.length)));
try {
return JSON.parse(decodeURIComponent(cookie.substring(nameEQ.length)));
} catch(err) {
// wrong cookie, delete it
this.set_cookie(name, '', -1);
}
}
}
return null;