Website generation with Couscous

This commit is contained in:
Milos Stojanovic
2019-11-01 15:57:04 +01:00
parent edadd1570f
commit 357b2597c0
2 changed files with 14 additions and 1 deletions

View File

@@ -168,6 +168,19 @@
],
</code></pre>
<p>Don't forget to enter correct database details.</p>
<h2 id="configuring-session-service-to-use-redis">Configuring Session service to use Redis</h2>
<p>You must require additional library <code>composer require predis/predis</code></p>
<pre><code> 'Filegator\Services\Session\SessionStorageInterface' =&gt; [
'handler' =&gt; '\Filegator\Services\Session\Adapters\SessionStorage',
'config' =&gt; [
'handler' =&gt; function () {
$predis = new \Predis\Client();
$handler = new \Symfony\Component\HttpFoundation\Session\Storage\Handler\RedisSessionHandler($predis);
return new \Symfony\Component\HttpFoundation\Session\Storage\NativeSessionStorage([], $handler);
},
],
],</code></pre>
<h2 id="tweaking-session-options">Tweaking session options</h2>
<p>The underying <a href="https://github.com/symfony/symfony/blob/4.4/src/Symfony/Component/HttpFoundation/Session/Storage/NativeSessionStorage.php">session component</a> accepts array of options.
For example you can pass <code>cookie_lifetime</code> parameter to extend default session lifetime:</p>