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?


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
| improve this answer | |
  • is there any way to just delete cookies from var/session folder instead of deleting complete folder. – Baby in Magento Dec 22 '15 at 7:41
  • 1
    You're missing the concept. Cookies are stored on the client computer and contain a session id. This id refers to a file in var/session where data like login status is stored. – Fabian Schmengler Dec 22 '15 at 7:49
  • 1
    you are right, but it's very difficult to inform the customers to delete cookies from their browser. is there any alternate solution for this ? – Baby in Magento Dec 22 '15 at 7:51
  • There has to be. But not for the question you asked here. – Fabian Schmengler Dec 22 '15 at 7:52
  • @fabian Want to clarify for myself: if we have in Magento admin Cookie/Session settings 864,000 (10days), so if customer do not visit store last 10 days, then magento in next visit generate new pair SESS/Cookie for that customer? there fore is it a Very Correct to clean-up "garbage" sessions older than this given 10 days (by -mtime +10 option , 10 days last modify)? – Andriy Gonchar Feb 20 '17 at 23:55

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.