Session Configuration

The session.php file contains settings related to user and operator sessions. This document provides a list of configuration items available in the file, allowing you to modify them as necessary.

Contents

Session Store

Available Session Stores

File-based

If you would like to change change the default directory for where sessions are stored, create or update /config/production/session.php as below:


    <?php

    return [

        'driver' => 'file',

        'files'  => '/absolute/path/to/writable/directory', // Do not including trailing slash

    ];
Redis

If you would like to store session data in Redis, please follow the below steps:

  1. Make sure your PHP configuration doesn't have any disable_functions listed. You can check this via Utilities > PHP Information within the operator panel, but please also ensure your PHP CLI (cron) configuration also has the same setup.
  2. Add your Redis connection information to /config/production/database.php (don't edit your MySQL configuration). To ensure a separate Redis database is created for sessions, please ensure the database parameter in the 'session' array is unique:
    
                <?php return array (
                  'connections' =>
                  array (
                    'mysql' =>
                    array (
                      ...
                    ),
                  ),
    
                  'redis' => [
                      'client' => 'predis',
                      'default' => [
                          'host'     => '192.168.1.150',
                          'port'     => 6379,
                          'database' => 0,
                      ],
                      'session' => [
                          'host'     => '192.168.1.150',
                          'port'     => 6379,
                          'database' => 1,
                      ]
                  ],
                );
            
  3. Create or update /config/production/session.php
    
                <?php return [ 'driver' => 'redis', 'connection' => 'session', ];
            

Configuration Items

For details on how to set the below configuration items, please create a /config/production/session.php file and read: Updating Config Files.

Name Description Valid Value(s)
single_session

By default operators can be logged in on multiple devices at once, however you may want to let them only use one device at a time, logging them out of others immediately. If so, set this value to true.

true/false