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

pascal83's avatar

Session file to declare all variable session

Hello to all,

I want to declare multiple session variables. I want to put them all in the same file and then call the file to create my variable sessions.

And so, every page load, I check if my session is set... and if not, I set them by calling this file..

In php i did :

if(!isset($_SESSION["city"])) { include 'sessions.php' } to create all session variable required.

Can i do that in Laravel ?

Thanks

Pascal

0 likes
0 replies

Please or to participate in this conversation.