How to locate your session files

Locate your session storage

This topic discusses how to locate where your session files are stored. The Magento application uses the following logic to store session files:

  • If you configured memcached, sessions are stored in RAM; for more information, see Use memcached for session storage.
  • If you configured Redis, sessions are stored on the Redis server; for more information, see Use Redis for page caching or session storage.
  • If you’re using the default file-based session storage, we store sessions in the following locations in the order shown:

    1. Directory defined in env.php
    2. Directory defined in php.ini
    3. <magento_root>/var/session directory

env.php example

A sample snippet from <magento_root>/app/etc/env.php follows:

1
2
3
4
5
 'session' =>
    array (
      'save' => 'files',
      'save_path' => '/var/www/session',
 ),

The preceding example stores session files in /var/www/session

php.ini example

As a user with root privileges, open your php.ini file and search for the value of session.save_path. This identifies where sessions are stored.