Closed
Description
As defined in Symfony/Bundle/FrameworkBundle/Resources/config/session.xml:
<service id="session.storage.native_file" class="%session.storage.native_file.class%" public="false">
<argument>%kernel.cache_dir%/sessions</argument>
<argument>%session.storage.options%</argument>
</service>
and with default session.storage.native_file.class = Symfony\Component\HttpFoundation\Session\Storage\NativeFileSessionStorage,
all session files are stored in app/cache/[env]/sessions directory by default. This is unexpected behavior, normally I would expect to have these files in directory defined in php config "session.save_path".
Current solution has 3 drawbacks:
- it's unexpected, normally I wouldn't search for my session files in app/cache/[env]/sessions, when my php session.save_path is set to something else,
- when I call cache:clear task, all session files are deleted,
- garbage collectors for session files (in Debian it's cron task) don't know about app/cache/[env]/sessions directories so that they are not purged
%kernel.cache_dir%/sessions default argument for session.storage.native_file service should probably be replaced by php session.save_path value when available
(my php config is (debian default): session.auto_start off, session.save_handler files, session.save_path /var/lib/php5)