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

Commit

Permalink
small bug fix to handle deleting cookies when val is empty
Browse files Browse the repository at this point in the history
  • Loading branch information
ecaroth committed Feb 23, 2016
1 parent 190217d commit f36ea4a
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions src/xdomain_cookie.js
Original file line number Diff line number Diff line change
Expand Up @@ -90,6 +90,8 @@
function _set_xdomain_cookie_value( cookie_name, cookie_value, expires_days ){

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;

_set_local_cookie( cookie_name, cookie_value, expires_days );

Expand Down

0 comments on commit f36ea4a

Please sign in to comment.