Do you have expire_on_close set to true in your session config?
Thousands of files in session folder
I was moving my site to a new hosting and notice that there are thousands of files inside storage/framework/sessions.
Aren't they supposed to be deleted after ending a session? I don't actually use much sessions anywhere on the site since it is not a user-involved website.
You probably haven't made changes to the session config, have you?
If it's something like
'lifetime' => 120,
'expire_on_close' => false,
your session files should be deleted after their lifetime expires. If you set "expire_on_close" to "true" they should be deleted immediatly on browser closing.
Maybe it's a problem with file permissions, or with the settings of your old host.
If so, there is a good chance the problem fixed itself after moving to a new host. I would clear the whole folder manually and check if the problem persists.
Please or to participate in this conversation.