https://supertokens.com/ logo
Title
g

gwenael

10/24/2022, 10:11 AM
how we can set the cookie for all our domains
n

nkshah2

10/24/2022, 10:12 AM
Hi @gwenael, Are all the different BOs on sub domains?
g

gwenael

10/24/2022, 10:14 AM
our context is different because our backoffices are on xxx.domain1.com yyy.domain2.com zzz.domain3.com
n

nkshah2

10/24/2022, 10:16 AM
What are you using on your API layer?
g

gwenael

10/24/2022, 10:19 AM
the Auth is separated from the business API. - we use NodeJs for the auth API - we use 2 different APIs in PHP for each backoffice
r

rp

10/24/2022, 10:21 AM
You can’t set cookies across top level domains.
The way to solve this would be to create individual sessions for each of the api domains
Or, you could enable JWT based auth and send a JWT to these domains for session management.
g

gwenael

10/24/2022, 10:24 AM
thanks
r

rp

10/24/2022, 10:25 AM
Do these backend domains all have the same frontend (on the same url) or different frontends?
g

gwenael

10/24/2022, 10:26 AM
different urls because we have our old BO and our new BO and we want to use a unique auth solution for both.
r

rp

10/24/2022, 10:27 AM
I see. Then it’s best if you have different sessions for all of these and not try and share the same session
g

gwenael

10/24/2022, 10:27 AM
ok
but your solution is very cool.
r

rp

10/24/2022, 10:28 AM
Thanks