Do not share cookies between domain, only to api

13 Views Asked by At

I'm trying to setup this kind of architecture:

enter image description here

customer.app.com & admin.app.com are website, each of them are consuming the api (api.app.com)

I have httpOnly in each of theses website, basically storing accessToken & refreshToken sent by api.app.com

Example: I'm loging into admin.app.com, theses cookies are setup in browser (don't look at the domain, it's my dev environment)

enter image description here

The issue is, when I go to customer.app.com, theses cookies are also setup and I don't want. But I want them to be sent to api.app.com

How to have two "session" of cookies?

Thanks a lot

0

There are 0 best solutions below