Skip to content

Commit

Permalink
Merge pull request #56 from rtCamp/fix/adding-dot-to-the-domain
Browse files Browse the repository at this point in the history
Making the domain consistent
  • Loading branch information
gagan0123 authored Feb 27, 2024
2 parents 215134c + 99452a6 commit a851f03
Show file tree
Hide file tree
Showing 6 changed files with 6 additions and 6 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/demos/storage-access-api/routes.js
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,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/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 a851f03

Please sign in to comment.