I've already attempted to delete session files, but they come back one at a time and slowly... Huh? Can someone explain why please and help me permanently delete them please?

I can not locate them in the database as well.

I'd also like to know how to automatically remove old session files when this weird 'bug' is resolved.

Magento 2.2.4

SOLVED Turns out the garbage collector was disabled.

  • Well, the sessions need to be stored somewhere - either in the database, in redis, or in the file system. If you don't configure redis or the database, the session data needs to be stored in the file system... which is then PHP core functionality: serverfault.com/questions/138214/… ** Update: You just added the information that you use M2. In that case, I do not understand the information about the local.xml file. M2 should not have a local.xml file. Could you explain, please? – where Aug 15 '18 at 23:55
  • They are stored in /var/session/ but when deleted they return somehow. ** Update: Sorry, I don't know what file controls or shows where the session files are stored (db/file) in M2 then. Could you tell me? – Kist221 Aug 15 '18 at 23:57
  • Everytime someone browses on the website, a session file will be created. That's a feature. :) It helps identifying the user across multiple requests. Take care: If you delete them in a production system, users' shopping carts will suddenly be empty... – where Aug 15 '18 at 23:58
  • I understand their purpose, just not how they are implemented, what controls where I choose to store them, and how to successfully remove old/expired sessions permanently without them returning. – Kist221 Aug 16 '18 at 0:02
  • My root's php.ini file only contains session.save_path=/home/***/public_html/var/session "***" for privacy. It doesn't contain other config options though. – Kist221 Aug 16 '18 at 0:04

Your Answer

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

Browse other questions tagged or ask your own question.