Hello everyone.
I have developed a web application. In my dev environnement I used the filesystem to store my session and it works, Now I would like to store those session data on a redis server.
So I would like to know how to tell my application to store the session datas on the redis server ? Do I need any configuration on my PHP.ini files ?
Here is my global.php file
<?php
/**
* Global Configuration Override
*
* You can use this file for overriding configuration values from modules, etc.
* You would place values in here that are agnostic to the environment and not
* sensitive to security.
*
* NOTE: In practice, this file will typically be INCLUDED in your source
* control, so do not include passwords or other sensitive information in this
* file.
*/
use Laminas\Session\Storage\SessionArrayStorage;
use Laminas\Session\Validator\RemoteAddr;
use Laminas\Session\Validator\HttpUserAgent;
include_once __DIR__ . '/../navigation/navigations.config.php';
return [
// ...
// Session configuration.
'session_config' => [
// Session cookie will expire in 1 hour.
'cookie_lifetime' => 60*60*1,
// Session data will be stored on server maximum for 30 days.
'gc_maxlifetime' => 60*60*24*30,
'savePath' => __DIR__ . '/../../data/sessions',
],
// Session manager configuration.
'session_manager' => [
// Session validators (used for security).
'config' => [
'class' => \Laminas\Session\Config\SessionConfig::class,
'options' => [
'name' => 'myapp',
],
],
'validators' => [
RemoteAddr::class,
HttpUserAgent::class,
]
],
// Session storage configuration.
'session_storage' => [
'type' => SessionArrayStorage::class,
],
];
And my last question is : can I use Redis to store my cached translation files ?