Skip to content

Commit

Permalink
making the domain cosistent
Browse files Browse the repository at this point in the history
  • Loading branch information
fellyph committed Feb 26, 2024
1 parent a3fdf19 commit 99452a6
Show file tree
Hide file tree
Showing 5 changed files with 5 additions and 5 deletions.
2 changes: 1 addition & 1 deletion src/demos/chips/routes.js
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,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",
Expand Down
2 changes: 1 addition & 1 deletion src/scenarios/analytics/routes.js
Original file line number Diff line number Diff line change
Expand Up @@ -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",
Expand Down
2 changes: 1 addition & 1 deletion src/scenarios/payment-gateway/routes.js
Original file line number Diff line number Diff line change
Expand Up @@ -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
} );
Expand Down
2 changes: 1 addition & 1 deletion src/scenarios/personalization/routes.js
Original file line number Diff line number Diff line change
Expand Up @@ -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",
Expand Down
2 changes: 1 addition & 1 deletion src/scenarios/single-sign-on/routes.js
Original file line number Diff line number Diff line change
Expand Up @@ -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');
Expand Down

0 comments on commit 99452a6

Please sign in to comment.