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 - (Default)
- Redis - sessions are stored in fast, cache based stores, requires Redis database to be configured.
Create a new file
/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.
Do not use the same redis database for both your cache and session driver! The configuration steps described in this documentation will ensure a separate database is configured for each driver.
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