Skip to content
This repository has been archived by the owner on Oct 8, 2024. It is now read-only.

Commit

Permalink
add fix for expires days + formatting
Browse files Browse the repository at this point in the history
  • Loading branch information
ecaroth committed Feb 23, 2016
1 parent f36ea4a commit 6fc5b61
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions src/xdomain_cookie.js
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,7 @@
msg_type: 'xdsc_write',
cookie_name: cookie_name,
cookie_val: cookie_value,
expires_days: expires_days,
expires_days: expires_days
};

document.getElementById('xdomain_cookie_'+_id).contentWindow.postMessage(JSON.stringify(data), iframe_path );
Expand All @@ -74,7 +74,7 @@
var ca = document.cookie.split(';');
for(var i=0; i<ca.length; i++) {
var c = ca[i].trim();
if (c.indexOf(name) == 0) return decodeURIComponent( c.substring(name.length,c.length) );
if (c.indexOf(name) === 0) return decodeURIComponent( c.substring(name.length,c.length) );
}
return "";
}
Expand All @@ -91,7 +91,7 @@

expires_days = expires_days || _default_expires_days;
//if cookie is empty (null or undefined) delete the cookie
expires_days = (cookie_value===null || cookie_value===undefined) ? (new Date(0)) : expires_days;
expires_days = (cookie_value===null || cookie_value===undefined) ? -100 : expires_days;

_set_local_cookie( cookie_name, cookie_value, expires_days );

Expand Down

0 comments on commit 6fc5b61

Please sign in to comment.