You could probably lookup multi tenant in laravel and get some good ideas.
Laravel shared session, does not working only for login
I am using shared session with some subdomains of mine, were working but now stopped and I do not know why. They use the same key and the like in env.
APP_KEY=base64:d+JhMsQVeouOI82JPiQtIvBUjizigUxD75uCVt747ns=
SESSION_DRIVER=database
SESSION_LIFETIME=120
SESSION_DOMAIN='.global.test'
SESSION_COOKIE=global_session
SESSION_CONNECTION=session_storage
SESSION_DB_HOST=localhost
SESSION_DB=ged_global
SESSION_DB_USER=digitaliza
SESSION_DB_PASSWORD=
//my local variables
All subdomains and main domain using this exact same values
if i login on any one, i have to log again on every system, but if i logout i log out for everyone
I am looking at my database all of them using the same row in the session table.
What stopped the session from being shared was the implementation of the 404labfr/laravel-impersonate package. So between it and the session sharing I decided to run out of the package since the session directly impacts the user, and this package is only used internally for employees. I will open an issue about this impact in the sessions as it is a very interesting package.
Please or to participate in this conversation.