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

Kemito's avatar

Session sharing

Hi.

I am trying to get lumen into a project so i can start migrate or make new sections on Lumen. I needed a lightweight MVC framework so i choose Lumen. All went fine with few basic hacks. Now i am where i need to get sessions from $_SESSION. I understand that Lumen same as Laravel 'removes' super globals but how could i can access that $_SESSION or merge into Lumen session?

Any hints, ideas?

Thanks.

0 likes
5 replies
bashy's avatar
bashy
Best Answer
Level 65

Lumen and Laravel do not use native PHP sessions. Accessing $_SESSION will not be from Lumen or Laravel. You can read it if you set session_start(); and have it across that but depending on what you want to do, you should maybe use the same session data or driver. Setting the session data in the database would allow you to grab them from both Lumen and Laravel respectively.

Kemito's avatar

@bashy will it work on memcached driver same as database? According to sysadmin currently we are using memcache as session driver but lumen does not support that. :/ Asking for memcached driver maybe that will allow me to share this sessions.

bashy's avatar

Well yeah I'm not sure on that but as long as both app's code can access the session data, it will be shared.

Kemito's avatar

@bashy Thanks. Figured out the way to share sessions as well as login. Thanks for hinting.

Please or to participate in this conversation.