<p>@boboldehampsink to the rescue: <a href="https://github.com/craftcms/cms/issues/3428" rel="nofollow noreferrer">https://github.com/craftcms/cms/issues/3428</a></p>

<hr>

<p><strong>Update:</strong></p>

<p>This article covers things really well.
<a href="https://nystudio107.com/blog/the-case-of-the-missing-php-session" rel="nofollow noreferrer">https://nystudio107.com/blog/the-case-of-the-missing-php-session</a></p>

<p><strong>php ini config</strong></p>

<pre><code>[Session]
; http://www.php.net/manual/en/session.configuration.php#ini.session.save-handler
session.save_handler = redis
session.save_path = "tcp://127.0.0.1:6379"
</code></pre>

<p><strong>configurable in /../craft/web/index.php</strong></p>

<pre><code>define('REDIS_HOSTNAME', getenv('REDIS_HOSTNAME') ?: 'localhost');
ini_set('session.save_handler', 'redis');
ini_set('session.save_path', 'tcp://'.REDIS_HOSTNAME.':6379');
</code></pre>

CC BY-SA 4.0
2018-11-27T00:36:58.893Z
Sorry, link is dead.
misteraidan
CC BY-SA 4.0
2018-07-31T18:42:34.757Z
2018-11-27T15:18:07.127Z
2018-11-27T15:18:07.127Z
Tim Kelty
<p>I've configured Redis to handle cache and sessions for Craft 3, and while cache configuration is working as expected, I had to disable session configuration due to the below error.</p>

<p>It fails on the method <em>getAssetBundleFlashes</em></p>

<p>Are there any other settings (e.g. for PHP) that may be required?</p>

<p>Here is my Redis component config in <em>config/app.php</em> for Yii 2 (yes I've added the yii2-redis package to my composer file too).</p>

<pre><code>return [
    'components' =&gt; [
        'redis' =&gt; [
            'class' =&gt; yii\redis\Connection::class,
            'hostname' =&gt; getenv('REDIS_HOSTNAME'),
            'port' =&gt; 6379,
            'database' =&gt; 0,
        ],
        'session' =&gt; [
            'class' =&gt; yii\redis\Session::class,            
        ],
        'cache' =&gt; [
            'class' =&gt; yii\redis\Cache::class,
        ],
    ],
];
</code></pre>

<p>And here is the stack trace:</p>

<pre><code>An Error occurred while handling another error:
yii\base\UnknownMethodException: Calling unknown method: yii\redis\Session::getAssetBundleFlashes() in /srv/craft/vendor/yiisoft/yii2/base/Component.php:300
Stack trace:
#0 /srv/craft/vendor/craftcms/cms/src/web/View.php(896): yii\base\Component-&gt;__call('getAssetBundleF...', Array)
#1 /srv/craft/vendor/craftcms/cms/src/web/View.php(818): craft\web\View-&gt;registerAssetFlashes()
#2 /srv/craft/vendor/yiisoft/yii2/views/errorHandler/exception.php(526): craft\web\View-&gt;endBody()
#3 /srv/craft/vendor/yiisoft/yii2/base/View.php(336): require('/srv/craft/vend...')
#4 /srv/craft/vendor/yiisoft/yii2/base/View.php(254): yii\base\View-&gt;renderPhpFile('/srv/craft/vend...', Array)
#5 /srv/craft/vendor/yiisoft/yii2/web/ErrorHandler.php(266): yii\base\View-&gt;renderFile('/srv/craft/vend...', Array, Object(craft\web\ErrorHandler))
#6 /srv/craft/vendor/yiisoft/yii2/web/ErrorHandler.php(126): yii\web\ErrorHandler-&gt;renderFile('@yii/views/erro...', Array)
#7 /srv/craft/vendor/craftcms/cms/src/web/ErrorHandler.php(156): yii\web\ErrorHandler-&gt;renderException(Object(yii\base\UnknownMethodException))
#8 /srv/craft/vendor/yiisoft/yii2/base/ErrorHandler.php(111): craft\web\ErrorHandler-&gt;renderException(Object(yii\base\UnknownMethodException))
#9 /srv/craft/vendor/craftcms/cms/src/web/ErrorHandler.php(71): yii\base\ErrorHandler-&gt;handleException(Object(yii\base\UnknownMethodException))
#10 [internal function]: craft\web\ErrorHandler-&gt;handleException(Object(yii\base\UnknownMethodException))
#11 {main}
Previous exception:
yii\base\UnknownMethodException: Calling unknown method: yii\redis\Session::getAssetBundleFlashes() in /srv/craft/vendor/yiisoft/yii2/base/Component.php:300
Stack trace:
#0 /srv/craft/vendor/craftcms/cms/src/web/View.php(896): yii\base\Component-&gt;__call('getAssetBundleF...', Array)
#1 /srv/craft/vendor/craftcms/cms/src/web/View.php(818): craft\web\View-&gt;registerAssetFlashes()
#2 /srv/craft/storage/runtime/compiled_templates/0b/0b226b9457e83d59f4ca4ab9c0a794a8e7489d0fa5850859e4263059d8eeeb71.php(63): craft\web\View-&gt;endBody()
#3 /srv/craft/vendor/twig/twig/lib/Twig/Template.php(390): __TwigTemplate_dcb3cad6f26dfdd9b0c18a08e2464625842a6825bf5d95797cfd4aff7f9d3ba1-&gt;doDisplay(Array, Array)
#4 /srv/craft/vendor/craftcms/cms/src/web/twig/Template.php(49): Twig_Template-&gt;displayWithErrorHandling(Array, Array)
#5 /srv/craft/vendor/twig/twig/lib/Twig/Template.php(367): craft\web\twig\Template-&gt;displayWithErrorHandling(Array, Array)
#6 /srv/craft/vendor/craftcms/cms/src/web/twig/Template.php(31): Twig_Template-&gt;display(Array, Array)
#7 /srv/craft/storage/runtime/compiled_templates/92/928ab9c5030f542894551fd742424701943b57966d99233b0de96b7fd7dbc7fa.php(40): craft\web\twig\Template-&gt;display(Array, Array)
#8 /srv/craft/vendor/twig/twig/lib/Twig/Template.php(390): __TwigTemplate_566de35bd43d5ce1cf719a311929c2acf2baa3debb31cbeb7c6967ed2e3324cd-&gt;doDisplay(Array, Array)
#9 /srv/craft/vendor/craftcms/cms/src/web/twig/Template.php(49): Twig_Template-&gt;displayWithErrorHandling(Array, Array)
#10 /srv/craft/vendor/twig/twig/lib/Twig/Template.php(367): craft\web\twig\Template-&gt;displayWithErrorHandling(Array, Array)
#11 /srv/craft/vendor/craftcms/cms/src/web/twig/Template.php(31): Twig_Template-&gt;display(Array, Array)
#12 /srv/craft/storage/runtime/compiled_templates/df/df104a4367ddd257c886d6ca86296f015495978d68f657dc29d28b6b8d55ad76.php(94): craft\web\twig\Template-&gt;display(Array, Array)
#13 /srv/craft/vendor/twig/twig/lib/Twig/Template.php(390): __TwigTemplate_9f1f09a6b58c9f64d0f79651ec01d22c48213d3eb6b8317580edaa5e0f09bc62-&gt;doDisplay(Array, Array)
#14 /srv/craft/vendor/craftcms/cms/src/web/twig/Template.php(49): Twig_Template-&gt;displayWithErrorHandling(Array, Array)
#15 /srv/craft/vendor/twig/twig/lib/Twig/Template.php(367): craft\web\twig\Template-&gt;displayWithErrorHandling(Array, Array)
#16 /srv/craft/vendor/craftcms/cms/src/web/twig/Template.php(31): Twig_Template-&gt;display(Array, Array)
#17 /srv/craft/storage/runtime/compiled_templates/b9/b93d72fd3873b8f06d39c6630e8e2d8fcfadfd6798468d109266fec4e37c1dfe.php(32): craft\web\twig\Template-&gt;display(Array, Array)
#18 /srv/craft/vendor/twig/twig/lib/Twig/Template.php(390): __TwigTemplate_19451c5d966903f571459e857efabdca189708bebe8e4a3b3611e8d1061509a9-&gt;doDisplay(Array, Array)
#19 /srv/craft/vendor/craftcms/cms/src/web/twig/Template.php(49): Twig_Template-&gt;displayWithErrorHandling(Array, Array)
#20 /srv/craft/vendor/twig/twig/lib/Twig/Template.php(367): craft\web\twig\Template-&gt;displayWithErrorHandling(Array, Array)
#21 /srv/craft/vendor/craftcms/cms/src/web/twig/Template.php(31): Twig_Template-&gt;display(Array, Array)
#22 /srv/craft/vendor/twig/twig/lib/Twig/Template.php(375): craft\web\twig\Template-&gt;display(Array)
#23 /srv/craft/vendor/twig/twig/lib/Twig/Environment.php(289): Twig_Template-&gt;render(Array)
#24 /srv/craft/vendor/craftcms/cms/src/web/View.php(305): Twig_Environment-&gt;render('dashboard/_inde...', Array)
#25 /srv/craft/vendor/craftcms/cms/src/web/View.php(352): craft\web\View-&gt;renderTemplate('dashboard/_inde...', '[&lt;span class="s...')
#26 /srv/craft/vendor/craftcms/cms/src/web/Controller.php(113): craft\web\View-&gt;renderPageTemplate('dashboard/_inde...', '[&lt;span class="s...')
#27 /srv/craft/vendor/craftcms/cms/src/controllers/DashboardController.php(135): craft\web\Controller-&gt;renderTemplate('dashboard/_inde...', Array)
#28 [internal function]: craft\controllers\DashboardController-&gt;actionIndex()
#29 /srv/craft/vendor/yiisoft/yii2/base/InlineAction.php(57): call_user_func_array(Array, Array)
#30 /srv/craft/vendor/yiisoft/yii2/base/Controller.php(157): yii\base\InlineAction-&gt;runWithParams(Array)
#31 /srv/craft/vendor/craftcms/cms/src/web/Controller.php(74): yii\base\Controller-&gt;runAction('index', Array)
#32 /srv/craft/vendor/yiisoft/yii2/base/Module.php(528): craft\web\Controller-&gt;runAction('index', Array)
#33 /srv/craft/vendor/craftcms/cms/src/web/Application.php(238): yii\base\Module-&gt;runAction('dashboard/index', Array)
#34 /srv/craft/vendor/yiisoft/yii2/web/Application.php(103): craft\web\Application-&gt;runAction('dashboard/index', Array)
#35 /srv/craft/vendor/craftcms/cms/src/web/Application.php(227): yii\web\Application-&gt;handleRequest(Object(craft\web\Request))
#36 /srv/craft/vendor/yiisoft/yii2/base/Application.php(386): craft\web\Application-&gt;handleRequest(Object(craft\web\Request))
#37 /srv/craft/web/index.php(30): yii\base\Application-&gt;run()
#38 {main}
</code></pre>

CC BY-SA 4.0
2018-07-31T18:32:25.297Z
Having the same issue using yii\redis\Session…

Setting session.save_handler, session.save_path in php.ini works, however.
Tim Kelty
<craft3><cache><session><redis>
Craft CMS 3 - Redis Sessions cause error
# Craft CMS 3 - Redis Sessions cause error

(Asked by: username_0 on 2018-04-09)

I've configured Redis to handle cache and sessions for Craft 3, and while cache configuration is working as expected, I had to disable session configuration due to the below error.
It fails on the method getAssetBundleFlashes
Are there any other settings (e.g. for PHP) that may be required?
Here is my Redis component config in config/app.php for Yii 2 (yes I've added the yii2-redis package to my composer file too).
return [
    'components' => [
        'redis' => [
            'class' => yii\redis\Connection::class,
            'hostname' => getenv('REDIS_HOSTNAME'),
            'port' => 6379,
            'database' => 0,
        ],
        'session' => [
            'class' => yii\redis\Session::class,            
        ],
        'cache' => [
            'class' => yii\redis\Cache::class,
        ],
    ],
];

And here is the stack trace:
An Error occurred while handling another error:
yii\base\UnknownMethodException: Calling unknown method: yii\redis\Session::getAssetBundleFlashes() in /srv/craft/vendor/yiisoft/yii2/base/Component.php:300
Stack trace:
#0 /srv/craft/vendor/craftcms/cms/src/web/View.php(896): yii\base\Component->__call('getAssetBundleF...', Array)
#1 /srv/craft/vendor/craftcms/cms/src/web/View.php(818): craft\web\View->registerAssetFlashes()
#2 /srv/craft/vendor/yiisoft/yii2/views/errorHandler/exception.php(526): craft\web\View->endBody()
#3 /srv/craft/vendor/yiisoft/yii2/base/View.php(336): require('/srv/craft/vend...')
#4 /srv/craft/vendor/yiisoft/yii2/base/View.php(254): yii\base\View->renderPhpFile('/srv/craft/vend...', Array)
#5 /srv/craft/vendor/yiisoft/yii2/web/ErrorHandler.php(266): yii\base\View->renderFile('/srv/craft/vend...', Array, Object(craft\web\ErrorHandler))
#6 /srv/craft/vendor/yiisoft/yii2/web/ErrorHandler.php(126): yii\web\ErrorHandler->renderFile('@yii/views/erro...', Array)
#7 /srv/craft/vendor/craftcms/cms/src/web/ErrorHandler.php(156): yii\web\ErrorHandler->renderException(Object(yii\base\UnknownMethodException))
#8 /srv/craft/vendor/yiisoft/yii2/base/ErrorHandler.php(111): craft\web\ErrorHandler->renderException(Object(yii\base\UnknownMethodException))
#9 /srv/craft/vendor/craftcms/cms/src/web/ErrorHandler.php(71): yii\base\ErrorHandler->handleException(Object(yii\base\UnknownMethodException))
#10 [internal function]: craft\web\ErrorHandler->handleException(Object(yii\base\UnknownMethodException))
#11 {main}
Previous exception:
yii\base\UnknownMethodException: Calling unknown method: yii\redis\Session::getAssetBundleFlashes() in /srv/craft/vendor/yiisoft/yii2/base/Component.php:300
Stack trace:
#0 /srv/craft/vendor/craftcms/cms/src/web/View.php(896): yii\base\Component->__call('getAssetBundleF...', Array)
#1 /srv/craft/vendor/craftcms/cms/src/web/View.php(818): craft\web\View->registerAssetFlashes()
#2 /srv/craft/storage/runtime/compiled_templates/0b/0b226b9457e83d59f4ca4ab9c0a794a8e7489d0fa5850859e4263059d8eeeb71.php(63): craft\web\View->endBody()
#3 /srv/craft/vendor/twig/twig/lib/Twig/Template.php(390): __TwigTemplate_dcb3cad6f26dfdd9b0c18a08e2464625842a6825bf5d95797cfd4aff7f9d3ba1->doDisplay(Array, Array)
#4 /srv/craft/vendor/craftcms/cms/src/web/twig/Template.php(49): Twig_Template->displayWithErrorHandling(Array, Array)
#5 /srv/craft/vendor/twig/twig/lib/Twig/Template.php(367): craft\web\twig\Template->displayWithErrorHandling(Array, Array)
#6 /srv/craft/vendor/craftcms/cms/src/web/twig/Template.php(31): Twig_Template->display(Array, Array)
#7 /srv/craft/storage/runtime/compiled_templates/92/928ab9c5030f542894551fd742424701943b57966d99233b0de96b7fd7dbc7fa.php(40): craft\web\twig\Template->display(Array, Array)
#8 /srv/craft/vendor/twig/twig/lib/Twig/Template.php(390): __TwigTemplate_566de35bd43d5ce1cf719a311929c2acf2baa3debb31cbeb7c6967ed2e3324cd->doDisplay(Array, Array)
#9 /srv/craft/vendor/craftcms/cms/src/web/twig/Template.php(49): Twig_Template->displayWithErrorHandling(Array, Array)
#10 /srv/craft/vendor/twig/twig/lib/Twig/Template.php(367): craft\web\twig\Template->displayWithErrorHandling(Array, Array)
#11 /srv/craft/vendor/craftcms/cms/src/web/twig/Template.php(31): Twig_Template->display(Array, Array)
#12 /srv/craft/storage/runtime/compiled_templates/df/df104a4367ddd257c886d6ca86296f015495978d68f657dc29d28b6b8d55ad76.php(94): craft\web\twig\Template->display(Array, Array)
#13 /srv/craft/vendor/twig/twig/lib/Twig/Template.php(390): __TwigTemplate_9f1f09a6b58c9f64d0f79651ec01d22c48213d3eb6b8317580edaa5e0f09bc62->doDisplay(Array, Array)
#14 /srv/craft/vendor/craftcms/cms/src/web/twig/Template.php(49): Twig_Template->displayWithErrorHandling(Array, Array)
#15 /srv/craft/vendor/twig/twig/lib/Twig/Template.php(367): craft\web\twig\Template->displayWithErrorHandling(Array, Array)
#16 /srv/craft/vendor/craftcms/cms/src/web/twig/Template.php(31): Twig_Template->display(Array, Array)
#17 /srv/craft/storage/runtime/compiled_templates/b9/b93d72fd3873b8f06d39c6630e8e2d8fcfadfd6798468d109266fec4e37c1dfe.php(32): craft\web\twig\Template->display(Array, Array)
#18 /srv/craft/vendor/twig/twig/lib/Twig/Template.php(390): __TwigTemplate_19451c5d966903f571459e857efabdca189708bebe8e4a3b3611e8d1061509a9->doDisplay(Array, Array)
#19 /srv/craft/vendor/craftcms/cms/src/web/twig/Template.php(49): Twig_Template->displayWithErrorHandling(Array, Array)
#20 /srv/craft/vendor/twig/twig/lib/Twig/Template.php(367): craft\web\twig\Template->displayWithErrorHandling(Array, Array)
#21 /srv/craft/vendor/craftcms/cms/src/web/twig/Template.php(31): Twig_Template->display(Array, Array)
#22 /srv/craft/vendor/twig/twig/lib/Twig/Template.php(375): craft\web\twig\Template->display(Array)
#23 /srv/craft/vendor/twig/twig/lib/Twig/Environment.php(289): Twig_Template->render(Array)
#24 /srv/craft/vendor/craftcms/cms/src/web/View.php(305): Twig_Environment->render('dashboard/_inde...', Array)
#25 /srv/craft/vendor/craftcms/cms/src/web/View.php(352): craft\web\View->renderTemplate('dashboard/_inde...', '[renderTemplate('dashboard/_inde...', Array)
#28 [internal function]: craft\controllers\DashboardController->actionIndex()
#29 /srv/craft/vendor/yiisoft/yii2/base/InlineAction.php(57): call_user_func_array(Array, Array)
#30 /srv/craft/vendor/yiisoft/yii2/base/Controller.php(157): yii\base\InlineAction->runWithParams(Array)
#31 /srv/craft/vendor/craftcms/cms/src/web/Controller.php(74): yii\base\Controller->runAction('index', Array)
#32 /srv/craft/vendor/yiisoft/yii2/base/Module.php(528): craft\web\Controller->runAction('index', Array)
#33 /srv/craft/vendor/craftcms/cms/src/web/Application.php(238): yii\base\Module->runAction('dashboard/index', Array)
#34 /srv/craft/vendor/yiisoft/yii2/web/Application.php(103): craft\web\Application->runAction('dashboard/index', Array)
#35 /srv/craft/vendor/craftcms/cms/src/web/Application.php(227): yii\web\Application->handleRequest(Object(craft\web\Request))
#36 /srv/craft/vendor/yiisoft/yii2/base/Application.php(386): craft\web\Application->handleRequest(Object(craft\web\Request))
#37 /srv/craft/web/index.php(30): yii\base\Application->run()
#38 {main}

**Tags:** craft3, cache, session, redis

> **Comments:**
> **username_1**: Having the same issue using yii\redis\Session…  Setting session.save_handler, session.save_path in php.ini works, however.  

---

## 1 answers

### Answer by username_1 on 2018-07-31. Score: 3 | Accepted answer

@boboldehampsink to the rescue: https://github.com/craftcms/cms/issues/3428

Update:
This article covers things really well.
https://nystudio107.com/blog/the-case-of-the-missing-php-session
php ini config
[Session]
; http://www.php.net/manual/en/session.configuration.php#ini.session.save-handler
session.save_handler = redis
session.save_path = "tcp://127.0.0.1:6379"

configurable in /../craft/web/index.php
define('REDIS_HOSTNAME', getenv('REDIS_HOSTNAME') ?: 'localhost');
ini_set('session.save_handler', 'redis');
ini_set('session.save_path', 'tcp://'.REDIS_HOSTNAME.':6379');

> **Comments:**
> **username_0**: Sorry, link is dead.  

---

