Just wanted some clarification on a question I previously asked.

I'm going to clear my Magento's session folder (.../var/session/).

How many days should I clear it prior to? If I cleared the sessions folder entirely, would it break my Magento store?

Or should I allow around 7 days of session folder lee-way?

I'd be using this code via SSH:

find /public_html/var/session/ -mtime +7 -exec rm {} \;


sudo rm -rf /public_html/var/session/


As well as this, I dont believe there is a cron-job set up to automatically remove session folder contents, being as the inode space is at 98% because of it. Can anyone point me to a good guide or let me know how I would go about setting one up? Or at least a way to see why it hasnt run, if it has been set up that is



If you clear the entire folder you will "Kickout" all active users. The only other effect it will have on old users is they would not be able to login to their old active session. I doubt that you have sessions that last for 7 days (You most likely have Cookies that last that long)

A long term solution is to setup a php garbage collector to remove you expired session files.

| improve this answer | |

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.