Php – Diabling Symfony2 sessions files

PHPsessionsymfony

I'm looking for a way to disable the file saving of PHP sessions. (I do not need sessions in my application)

I tried to set save_path = NULL, but it only set it to the default path (/tmp).

Is there a way to do that ? Or maybe I shouldn't do it at all for reasons I ignore ?

Best Answer

PHP should only be creating session files is session_start() is called in your application (meaning it needs them) or PHP is configured to always start sessions.

Make sure session.auto_start = 0 is set in your php.ini so that the sessions are not started automatically

Once that's set if you aren't creating sessions then your save path shouldn't matter at all.

Related Topic