Be part of JetBrains PHPverse 2026 on June 9 – a free online event bringing PHP devs worldwide together.

dush's avatar
Level 1

Sharing a session between native PHP and a Laravel app

I have a native PHP app which does the authentication and then i need to share the same session with another laravel app. What I got from the internet was the only way to do this is to use a persistent database session. Can some one explain me how to do this? I am new to both PHP and laravel

0 likes
1 reply
bugsysha's avatar

In Laravel, you can select a driver for your sessions to be a database. You can change that in the config/session.php file or in the .env file. Then you would need to change the vanilla PHP app to follow the same configuration as Laravel and in theory, it should work. I wouldn't say that is the only way to do it, but it is a good start.

Please or to participate in this conversation.