We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
2 parents cdf01a5 + e4878a8 commit 91517adCopy full SHA for 91517ad
packages/script/src/index.js
@@ -5,7 +5,11 @@
5
const HOSTNAME = window.location.hostname;
6
7
const defaultOptions = {
8
- domain: HOSTNAME === 'localhost' ? undefined : `.${HOSTNAME}`,
+ domain:
9
+ HOSTNAME === 'localhost'
10
+ ? undefined
11
+ : // Remove 'www.' from the hostname (because we want to set the cookie on the root domain)
12
+ `.${HOSTNAME.replace(/^www\./, '')}`,
13
httpOnly: false,
14
path: '/',
15
sameSite: 'Lax',
0 commit comments