diff --git a/audit-ci.json b/audit-ci.json index 9ef402b2d..7edb4b42a 100644 --- a/audit-ci.json +++ b/audit-ci.json @@ -12,7 +12,8 @@ "GHSA-9wv6-86v2-598j", "GHSA-m6fv-jmcg-4jfg", "GHSA-cm22-4g7w-348p", - "GHSA-c7qv-q95q-8v27" + "GHSA-c7qv-q95q-8v27", + "GHSA-3xgq-45jj-v275" ], "moderate": true } diff --git a/src/cohesion/helpers.js b/src/cohesion/helpers.js index c66c9ae55..3db71fc43 100644 --- a/src/cohesion/helpers.js +++ b/src/cohesion/helpers.js @@ -27,9 +27,14 @@ export const getCorrelationID = () => { paramId = uuidv4(); } + // If the tagular correlation ID cookie was set before we added the change to + // specify the domain, it was automatically added to the current domain. + // Always delete the cookie with the current domain + new Cookies().remove(COOKIE_NAME, { domain: window.location.hostname, path: '/' }); + const expirationDate = new Date(); expirationDate.setMinutes(expirationDate.getMinutes() + 30); // 30 mins expiration from now - new Cookies().set(COOKIE_NAME, paramId, { expires: expirationDate, domain: `.${getDomain()}` }); + new Cookies().set(COOKIE_NAME, paramId, { expires: expirationDate, domain: `.${getDomain()}`, path: '/' }); return paramId; }; diff --git a/src/payment/PaymentPage.test.jsx b/src/payment/PaymentPage.test.jsx index f99de8d37..4a0bf6284 100644 --- a/src/payment/PaymentPage.test.jsx +++ b/src/payment/PaymentPage.test.jsx @@ -43,6 +43,10 @@ jest.mock('universal-cookie', () => { set(cookieName) { return MockCookies.result[cookieName]; } + + remove() { + return undefined; + } } return MockCookies; });