Common Database Development Tutorials, Guides & Insights
Unlock 1+ expert-curated common database tutorials, real-world code snippets, and modern dev strategies. From fundamentals to advanced topics, boost your common database skills on DeveloperBreeze.
Adblocker Detected
It looks like you're using an adblocker. Our website relies on ads to keep running. Please consider disabling your adblocker to support us and access the content.
Sharing Sessions Between Two Laravel Applications Using a Common Database
To ensure that session cookies are properly shared between the two applications, they need to be hosted on the same domain or subdomains. If they are hosted on different subdomains, you can configure the SESSION_DOMAIN variable in each application's .env file:
For example, if your apps are hosted on app1.example.com and app2.example.com, you can set the following in both .env files: