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

dust's avatar
Level 9

Strange things in session folder

I'm new to laravel and want to know what can delete session files in storage/framework/sessions/*

I have a project that is put on hold. That means that I haven't done anything for two months. No coding, no logging in. And I put that project on git. I have also script that checks all my projects if I forget to commit and push something. So two months - nothing. Today my script alert me for uncommitted changes. And that changes was deleted session files in my laravel project.

My question is how those files can be deleted without using that project? If there is no way of deleting session files without logging in, then may be someone else is trying to use my project. Although only I know the address.

0 likes
2 replies
al0mie's avatar

Maybe the sessions just ran out of time?

dust's avatar
Level 9

Definately they are out of time.

I've done some research and it seams that session files are cleaned randomly as defined in config/session.php

The one thing that I can't understand is how this random mechanisms are triggered?

When someone opens the site or what?

Please or to participate in this conversation.