Skip to content

Commit

Permalink
fixes prebid#2229 - Edge cookie string form
Browse files Browse the repository at this point in the history
  • Loading branch information
John W. Ellis committed Mar 7, 2018
1 parent 02ebe3a commit 308da3c
Showing 1 changed file with 5 additions and 5 deletions.
10 changes: 5 additions & 5 deletions modules/yieldbotBidAdapter.js
Original file line number Diff line number Diff line change
Expand Up @@ -535,13 +535,13 @@ export const YieldbotAdapter = {
},

setCookie: function(name, value, expireMillis, path, domain, secure) {
const expireTime = expireMillis ? new Date(Date.now() + expireMillis).toGMTString() : '';
const dataValue = encodeURIComponent(value);
const docLocation = path || '';
const pageDomain = domain || '';
const httpsOnly = secure ? ';secure' : '';
const cookieStr = name + '=' + dataValue +
(expireMillis ? ';expires=' + new Date(Date.now() + expireMillis).toGMTString() : '') +
(path ? ';path=' + path : '') +
(domain ? ';domain=' + domain : '') +
(secure ? ';secure' : '');

const cookieStr = `${name}=${dataValue};expires=${expireTime};path=${docLocation};domain=${pageDomain}${httpsOnly}`;
document.cookie = cookieStr;
},

Expand Down

0 comments on commit 308da3c

Please sign in to comment.