Magento 1.9 – Keeping Customers Logged In After Deleting var/session

cookiemagento-1.9session

we are facing some problem in live site as below link.

For my knowledge if we delete var/session folder, than we have to login to both frontend and backend .

To solve this problem : Live site blank in frontend or keep on loading and never load we have to delete the session folder again and again. is there any way if we delete session folder also , we can keep our customers logged in for the site?

Best Answer

No. The sessions are what keeps your customers logged in. But deleting all the sessions can't be the solution to whatever problem you face. Either it's enough to delete cookies to loose your own session or there's really something broken with the sessions, then you are just fighting symptoms and creating new problems.

A warning for everybody who is tempted to delete var/session!

This will log out all your customers and delete the carts of guest customers. If you have visitors that might want to buy something, this is really bad for your business!

If your disk is full and your goal is to make some space, you can use this command to only remove session files older than 7 days:

find var/session -name 'sess_*' -type f -mtime +7 -delete