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.
Available Session Stores
file- sessions are stored in
redis- sessions are stored in fast, cache based stores, requires Redis database to be configured.
/config/productionfolder instead of updating the
session.phpfound in the main
/configfolder, this will mean your configuration is not lost when you update your system.
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 ];
If you would like to store session data in Redis, please follow the below steps:
- Make sure your PHP configuration doesn't have any
disable_functionslisted. 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.
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:/config/production/database.php Expand Collapse
<?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, ] ], );
Create or update
<?php return [ 'driver' => 'redis', 'connection' => 'session', ];
For details on how to set the below configuration items, please create a
/config/production/session.php file and read: Updating Config Files.
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