How to share session between domain & sub-domain in Laravel
Sometime you have need to share session between domain & sub domain the way I was need it. I had searched a little and finally fixed my problem. That’s why I am going to share the solution with you all. Few steps that you have to do:
1) make sure to keep same app domain name that is located IN config/session file
2) change session driver (file to database) in config/session file
3) change session driver from .env file
4) keep the both site same app id in .env file
Then Command:
PHP ARTISAN SESSION::TABLE
PHP ARTISAN MIGRATE
above command will create a table in your database
that is all, hope this will solve your problem. If you have any issue comment be below section.
I am professional Web Designer & Developer. I have 5+ years of experience in relevant field. Currently I am working for a private software company named “Ollyo” as a Senior Staff Software Engineer.