Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Discovery Bid Adapter : Extend the expiration time of pmguid #11154

Merged
merged 13 commits into from
Mar 11, 2024
Merged
9 changes: 5 additions & 4 deletions modules/discoveryBidAdapter.js
Original file line number Diff line number Diff line change
Expand Up @@ -65,7 +65,7 @@ const NATIVERET = {
};

/**
* get page title
* get page title111
* @returns {string}
*/

Expand Down Expand Up @@ -133,10 +133,11 @@ export const getPmgUID = () => {
let pmgUid = storage.getCookie(COOKIE_KEY_PMGUID);
if (!pmgUid) {
pmgUid = utils.generateUUID();
try {
storage.setCookie(COOKIE_KEY_PMGUID, pmgUid, getCurrentTimeToUTCString());
} catch (e) {}
}
// Extend the expiration time of pmguid
try {
storage.setCookie(COOKIE_KEY_PMGUID, pmgUid, getCurrentTimeToUTCString());
} catch (e) {}
return pmgUid;
};

Expand Down
2 changes: 1 addition & 1 deletion test/spec/modules/discoveryBidAdapter_spec.js
Original file line number Diff line number Diff line change
Expand Up @@ -219,7 +219,7 @@ describe('discovery:BidAdapterTests', function () {
storage.getCookie.callsFake(() => 'existing-uuid');
const uid = getPmgUID();
expect(uid).to.equal('existing-uuid');
expect(storage.setCookie.called).to.be.false;
expect(storage.setCookie.called).to.be.true;
});

it('should not set new UUID when cookies are not enabled', () => {
Expand Down