I see there are thousands of files in my "/tmp" directory (a CentOS machine) and almost all of them are PHP session files.
I'm worried about the possible impact this might have on my system.
Are those files ever deleted either by the OS, Apache or PHP? or I have to take care of it myself?
Tell me more
×
Server Fault is a question and answer site for
professional system and network administrators. It's 100% free, no registration required.
|
|
|||||||||
|
|
They should be deleted by the PHP garbage collector. The frequency is controlled by the |
|||||||||||
|
|
On default Debian and Ubuntu, the sessions are cleaned up by cron
where |
||||
|
|
|
You could setup a cron script to clean them up automatically. It's generally a good idea to test for creation date older than what the life of cookies is set up to be on your system. Limiting cookie life is done thusly (must be done before script outputs anything):
Then, in your cleanup script:
Then, in your crontab:
|
|||
|
|