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

StarTrix's avatar

Session created for every request?

I'm using a simple hello world closure

Route::get('hi',function(){
return "Hello World!;
});

I then go to check app/storage/sessions folder, and for every time I refresh the /hi route , I find a new file created in the sessions folder (when I refresh the page 5 times I find 5 files). Is this how it should work or I have something set improperly ?

The contents of the session file has:

a:3:{s:6:"_token";s:40:"B79EsVhGP6JOmQ7z83ipUXqPnqI0OhVUityMtOtm";s:9:"_sf2_meta";a:3:{s:1:"u";i:1423652848;s:1:"c";i:1423652848;s:1:"l";s:1:"0";}s:5:"flash";a:2:{s:3:"old";a:0:{}s:3:"new";a:0:{}}}

And there is no cookies are set in my browser , that is why sessions get re-created?

0 likes
1 reply
StarTrix's avatar

Hmm it is now working correctly.. This worries me more than not working all time .. Because it becomes unpredictible this way and I wont be able to find the reason easily. Any advice?

Please or to participate in this conversation.