diff --git a/src/demos/chips/routes.js b/src/demos/chips/routes.js index 799d7d2..6d7cabd 100644 --- a/src/demos/chips/routes.js +++ b/src/demos/chips/routes.js @@ -25,7 +25,7 @@ router.get( '/analytics.js', ( req, res ) => { // Store the analytics ID in a cookie res.cookie( 'analyticsId', analyticsId, { - Domain: res.locals.domainC, + Domain: `.${res.locals.domainC}`, maxAge: 30 * 24 * 60 * 60 * 1000, // 30 days httpOnly: true, sameSite: "none", diff --git a/src/scenarios/analytics/routes.js b/src/scenarios/analytics/routes.js index 3e69dcd..cc64dfb 100644 --- a/src/scenarios/analytics/routes.js +++ b/src/scenarios/analytics/routes.js @@ -34,7 +34,7 @@ router.get('/analytics.js', (req, res) => { // Store the user name in a cookie res.cookie('userName', userName, { - Domain: res.locals.domainC, + Domain: `.${res.locals.domainC}`, maxAge: 30 * 24 * 60 * 60 * 1000, // 30 days httpOnly: true, sameSite: "none", diff --git a/src/scenarios/payment-gateway/routes.js b/src/scenarios/payment-gateway/routes.js index b454de5..69224ab 100644 --- a/src/scenarios/payment-gateway/routes.js +++ b/src/scenarios/payment-gateway/routes.js @@ -19,7 +19,7 @@ router.get( '/payment-form', ( req, res ) => { res.cookie( 'session_id', 'some_random_session_id', { maxAge: 900000, httpOnly: true, - domain: res.locals.domainC, + domain: `.${res.locals.domainC}`, sameSite: 'none', secure: true } ); diff --git a/src/scenarios/personalization/routes.js b/src/scenarios/personalization/routes.js index 8710137..c541a30 100644 --- a/src/scenarios/personalization/routes.js +++ b/src/scenarios/personalization/routes.js @@ -22,7 +22,7 @@ router.post( '/set-personalization', ( req, res ) => { } res.cookie('theme', theme, { - domain: res.locals.domainC, + domain: `.${res.locals.domainC}`, maxAge: 30 * 24 * 60 * 60 * 1000, // 30 days httpOnly: true, sameSite: "none", diff --git a/src/scenarios/single-sign-on/routes.js b/src/scenarios/single-sign-on/routes.js index 77ac535..8e26190 100644 --- a/src/scenarios/single-sign-on/routes.js +++ b/src/scenarios/single-sign-on/routes.js @@ -46,7 +46,7 @@ router.get('/sign-in', (req, res) => { router.post('/validate', (req, res) => { const email = req.body.email; if (email) { - res.cookie('email', email, { maxAge: 900000, httpOnly: true, domain: res.locals.domainC, sameSite: "none", secure: true }); + res.cookie('email', email, { maxAge: 900000, httpOnly: true, domain: `.${res.locals.domainC}`, sameSite: "none", secure: true }); res.render(path.join(__dirname, 'postmessage'), { email: email }); } else { res.status(400).send('Email validation failed');