Redis session docs

This commit is contained in:
Milos Stojanovic
2019-11-01 15:56:46 +01:00
parent ea6933883f
commit fbc582705c
3 changed files with 19 additions and 2 deletions

View File

@@ -54,6 +54,23 @@ Then, open `configuration.php` and update Session handler to:
```
Don't forget to enter correct database details.
## Configuring Session service to use Redis
You must require additional library `composer require predis/predis`
```
'Filegator\Services\Session\SessionStorageInterface' => [
'handler' => '\Filegator\Services\Session\Adapters\SessionStorage',
'config' => [
'handler' => function () {
$predis = new \Predis\Client();
$handler = new \Symfony\Component\HttpFoundation\Session\Storage\Handler\RedisSessionHandler($predis);
return new \Symfony\Component\HttpFoundation\Session\Storage\NativeSessionStorage([], $handler);
},
],
],
```
## Tweaking session options