Clean Magento session folder

On a VPS hosting Magento 1.9 disk was getting full. On checking, found var/session folder taking too much disk space.

Disk usage was 34 GB.

This folder is used to store PHP session files. You can delete them.

I created a cronjob to delete the session files that are older.

Add following content

Make it executable

Set a cronjob to run everyday

Method 2 – Strong session in database

Edit file


Replace with


Need help with Linux Server or WordPress? We can help!

Leave a Reply

Your email address will not be published. Required fields are marked *