Hi, what is the difference between "Sharing sessio...
# support-questions
c
Hi, what is the difference between "Sharing sessions across subdomains" (https://supertokens.com/docs/passwordless/common-customizations/sessions/share-sessions-across-sub-domains) and working with multiple api endpoints (https://supertokens.com/docs/passwordless/common-customizations/sessions/multiple-api-endpoints) ? In my case I have one react front end and two APIs, one is the default nextjs api routes and the second one is to get around their 4.5MB limits. I'm assuming I need to use the multiple api endpoints instructions which involves setting the cookie domain. Is that correct? Thank you for the help!
n
So sharing cookies would imply that you have api.domain.com for your backend and you have frontend hosted on different subdomains (a.frontend.com and b.frontend.com) and you want your frontends to share sessions
Multiple api domains would imply that you have one single frontend frontend.com and you have multiple api endpoints api.com and api2.com
If the two NextJS api layers are on different domains then yes you need to use the multiple endpoints guide
c
awesome, thanks for the answer @nkshah2
n
Happy to help