diff --git a/apps/SageAccountWeb/src/components/AccountSettings.tsx b/apps/SageAccountWeb/src/components/AccountSettings.tsx index e482eb9a2b0..f757b1b6dd2 100644 --- a/apps/SageAccountWeb/src/components/AccountSettings.tsx +++ b/apps/SageAccountWeb/src/components/AccountSettings.tsx @@ -101,9 +101,11 @@ export const AccountSettings = () => { const current = new Date() const nextYear = new Date() nextYear.setFullYear(current.getFullYear() + 1) + const hostname = window.location.hostname.toLowerCase() cookies.set(SynapseConstants.DATETIME_UTC_COOKIE_KEY, isUTCTime, { path: '/', expires: nextYear, + domain: hostname.endsWith('.synapse.org') ? 'synapse.org' : undefined, }) }, [isUTCTime]) diff --git a/packages/synapse-react-client/src/utils/hooks/useCookiePreferences.ts b/packages/synapse-react-client/src/utils/hooks/useCookiePreferences.ts index 677bfdc3c08..7bfbaf11958 100644 --- a/packages/synapse-react-client/src/utils/hooks/useCookiePreferences.ts +++ b/packages/synapse-react-client/src/utils/hooks/useCookiePreferences.ts @@ -58,9 +58,11 @@ export const useCookiePreferences = (): [ const current = new Date() const nextYear = new Date() nextYear.setFullYear(current.getFullYear() + 1) + const hostname = window.location.hostname.toLowerCase() cookies.set(COOKIES_AGREEMENT_COOKIE_KEY, prefs, { path: '/', expires: nextYear, + domain: hostname.endsWith('.synapse.org') ? 'synapse.org' : undefined, }) setCookiePreferencesAtomValue(prefs)