Skip to content

Commit

Permalink
Add a test partitioned cookie without __Host prefix so as to add a Do…
Browse files Browse the repository at this point in the history
…main attribute
  • Loading branch information
gagan0123 committed Nov 30, 2023
1 parent abb1c40 commit 1013277
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion 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: 'domain-ccc.com',
Domain: res.locals.domainC,
maxAge: 30 * 24 * 60 * 60 * 1000, // 30 days
httpOnly: true,
sameSite: "none",
Expand All @@ -47,6 +47,9 @@ router.get( '/analytics.js', ( req, res ) => {
res.append(
'Set-Cookie', '__Host-analyticsId-chips=' + analyticsIdCHIPS + '; Max-Age=' + expire + '; HttpOnly; Secure; Path=/; SameSite=None; Partitioned;'
);
res.append(
'Set-Cookie', 'analyticsId-chips-test=' + analyticsIdCHIPS + ';Domain='+res.locals.domainC+'; Max-Age=' + expire + '; HttpOnly; Secure; Path=/; SameSite=None; Partitioned;'
);
}

// Set the appropriate content type and send the analytics code
Expand Down

0 comments on commit 1013277

Please sign in to comment.