Subdomain Session Cookie - Multi Tenancy with Central Login
I use stancl/tenancy. My application has a central login located at localhost:8000. When I login I get redirected to the dashboard, all fine. But when I try to enter a subdomain of a tenant like example.localhost:8000 I get redirected back to the central domain.
This is because my session cookie's domain is set to localhost in the browser. When I manually change my cookie's domain to example.localhost and try to access example.localhost:8000, I can access the site and won't get redirected.
#config/session.php
SESSION_CONNECTION=mysql #session cookies are stored in the central db
SESSION_DRIVER=database
SESSION_LIFETIME=525600
SESSION_ENCRYPT=false
SESSION_PATH=/
SESSION_DOMAIN=null #tried setting this to .localhost but the cookie's domain stays as localhost
Can't I assign my session cookie's domain something like a wildcard? *.localhost