Session Updates in Subdomain Environments Are Not Reflected Automatically Across Domains #12736
Unanswered
geunheejung
asked this question in
Help
Replies: 0 comments
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
Environment
"next": "14.1.1"
"next-auth": "^5.0.0-beta.25"
Issue Description
Our service operates under two subdomains:
uk.domain.city
andkr.domain.city
.We have configured cookies to be shared across subdomains.
However, when a user logs in or logs out on the
uk
subdomain, the session update is not automatically reflected on thekr
subdomain unless the page is manually refreshed.From my understanding,
<SessionProvider/>
is responsible for keeping session data in sync across different parts of the application.Looking into the internal implementation, it seems that the
Broadcast Channel API
is used to synchronize session changes across different tabs.Since subdomains have different origins, could this be the reason why the session update is not reflected across them?
If so, what would be the best approach to ensure session updates are automatically synchronized across subdomains?
Any guidance would be greatly appreciated.
Thank you!
Beta Was this translation helpful? Give feedback.
All reactions