#Sharing sessions across 2 Laravel Applications

1 messages · Page 1 of 1 (latest)

crude halo
#

Hello guys,

I'm facing an issue with Laravel, I have two different applications:

  • 1 application (legacy) running on Laravel 7x
  • 1 application running on Laravel 10x

The Laravel 7x is handling the login/logout for now.
Both applications are configured to run the sessions on REDIS DATABASE.

SESSION_DRIVER=redis
SESSION_LIFETIME=120
SESSION_COOKIE=preprod_v3
SESSION_DOMAIN=.preprod-v3.mariole.com

Two problems:

  • When I clear the REDIS DB (redis-cli + 'FLUSHDB'), I'm not disconnected from both applications.
  • When I'm logging out from APP 1 and in the same time I have another tab of APP 2 opened, I'm not disconnected from the APP 2 even after a refresh.

Can you please help me in that ? I think there is one thing that I don't really understand, a basis of the sessions on Laravel.

Thanks.

rapid fjord
#

If you selected remember me on login, an authorized session will be regenerated automatically. Could that be it?

crude halo
#

I don't know, but how do you explain that when I'm cleaning REDIS DB, the user is still connected on both applications ?