I am not sure from memory, but I think if you set this variable on your .env:
SESSION_DOMAIN=.domain.com
The session cookie will be shared amongst subdomains.
Note the leading dot (.) before the domain name.
Be part of JetBrains PHPverse 2026 on June 9 – a free online event bringing PHP devs worldwide together.
I've got a Laravel backend app on my.domain.com and a Nuxt frontend with nuxt-auth on www.domain.com. The Sanctum auth works great when logging in via www. My question is if someone logs in via the my.domain site, how can that cascade so that they are also logged in on www.domain? I assume there is some sort of check that I'll have to make on my Nuxt app but am unsure of the next step. Any assistance would be very helpful. Thanks!
Please or to participate in this conversation.