Skip to content

Commit

Permalink
adding partitioned with cookie method
Browse files Browse the repository at this point in the history
  • Loading branch information
fellyph committed May 1, 2024
1 parent 36d44fa commit 700cb86
Showing 1 changed file with 8 additions and 7 deletions.
15 changes: 8 additions & 7 deletions src/demos/chips/routes.js
Original file line number Diff line number Diff line change
Expand Up @@ -39,13 +39,14 @@ router.get( '/analytics.js', ( req, res ) => {

if ( !analyticsIdCHIPS ) {
analyticsIdCHIPS = uuid.v4();
let expire = 30 * 24 * 60 * 60 * 1000;
/*res.append(
'Set-Cookie', '__Host-analyticsId-chips=' + analyticsIdCHIPS + '; Max-Age=' + expire + '; HttpOnly; Secure; Path=/; SameSite=None; Partitioned;'
);*/
res.append(
'Set-Cookie', 'analyticsId-chips=' + analyticsIdCHIPS + ';Domain='+res.locals.domainC+'; Max-Age=' + expire + '; HttpOnly; Secure; Path=/; SameSite=None; Partitioned;'
);
res.cookie( 'analyticsId-chips', analyticsIdCHIPS, {
domain: `.${res.locals.domainC}`,
maxAge: 30 * 24 * 60 * 60 * 1000, // 30 days
httpOnly: true,
sameSite: "none",
secure: true,
partitioned: true
} );
}

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

0 comments on commit 700cb86

Please sign in to comment.