Skip to content

Commit

Permalink
Account for www. in domain
Browse files Browse the repository at this point in the history
  • Loading branch information
steven-tey committed Oct 23, 2024
1 parent cdf01a5 commit 0385c6c
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion packages/script/src/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,10 @@
const HOSTNAME = window.location.hostname;

const defaultOptions = {
domain: HOSTNAME === 'localhost' ? undefined : `.${HOSTNAME}`,
domain:
HOSTNAME === 'localhost'
? undefined
: `.${HOSTNAME.replace(/^www\./, '')}`,
httpOnly: false,
path: '/',
sameSite: 'Lax',
Expand Down

0 comments on commit 0385c6c

Please sign in to comment.