Welcome Guest, Not a member yet? Register   Sign In
Redis session driver broken

(This post was last modified: 01-28-2016, 12:13 PM by spjonez.)

A PHP Error was encountered
Severity: Notice
Message: Undefined index: timeout
Filename: drivers/Session_redis_driver.php
Line Number: 148

$config['sess_driver'] = 'redis';
$config['sess_save_path'] = 'tcp://localhost:6379';

I'm assuming timeout should be set in this block?

        elseif (preg_match('#(?:tcp://)?([^:?]+)(?:\:(\d+))?(?<options>\?.+)?#', $this->_config['save_path'], $matches))
            $save_path = array(
                'host' => $matches[1],
                'port' => empty($matches[2]) ? NULL : $matches[2]

Line 148 in that file is, and always has been (in released versions) a return statement. I guess you're using an old dev version.

(This post was last modified: 01-29-2016, 08:36 AM by spjonez.)

I'm using the latest code from Git.

https://github.com/bcit-ci/CodeIgniter/b...driver.php construct method, line 148 references $this->_config['save_path']['timeout'] which is not defined with the other keys in construct.

(This post was last modified: 07-18-2016, 11:53 AM by Nichiren.)

I came across the same "Undefined index: timeout" error in line 155 of Session_redis_driver.php after updating my system files to the latest CI version 3.1.0-dev today. The quick fix for me was to explicitly set the timeout value in sess_save_path since the code assumes timeout is set: $config['sess_save_path'] = 'tcp://';

3.1.0-dev is NOT the latest code and it is UNSTABLE.
Don't use it.

Theme © iAndrew 2016 - Forum software by © MyBB