I am using Laravel with Sanctum.
I have 2 SPA's (Vue apps) at different ports:
localhost:8080
-> spa1 (admin area)localhost:8081
-> spa2 (member area)
My API communicates with both SPAs.
localhost:8000 -> api
The problem is, whenever I authenticate in spa1, spa2 is authenticated also.
I placed these 2 environment variables for Sanctum in .env
:
SESSION_DOMAIN=localhost
SANCTUM_STATEFUL_DOMAINS=localhost:8080,localhost:8081
I am expecting to authenticate with one account in spa1 and with another account in spa2. I do not want to share any session/cookie between spa1 and spa2.