1
votes

I am using CI version 3.0.3, PHP version 7.0, Redis and MariaDB. When I store session data in the Database, there are no errors. But if I switch to Redis, I get an error every time session tries to regenerate via session_regenerate_id, in my case every 300 sec. But if I refresh the page again, Redis get updated and page loads without errors.

A PHP Error was encountered

Severity: 4096

Message: session_regenerate_id(): Failed to create(read) session ID: user (path: tcp://localhost:6379?auth=xxxx)

Filename: Session/Session.php

Line Number: 625

2
I think you have to report this as a bug over here: github.com/bcit-ci/CodeIgniter/issues since your issue resides in the framework's system files.ahmad
As far as I can see it is introduced in PHP 7 given session_regenerate_id() is a direct PHP function/method. I have created a bug report - github.com/bcit-ci/CodeIgniter/issues/4362Degp

2 Answers

0
votes

This is a php / memcached bug related.

Work around:

class MemcachedSession extends SessionHandler { public function read($session_id) { return (string)parent::read($session_id); } }

$sess = new MemcachedSession(); session_set_save_handler($sess, true);

session_start(); $_SESSION['value'] = session_id(); session_regenerate_id(); ?>
0
votes

Please refer https://github.com/bcit-ci/CodeIgniter/commit/79b8a086187f199bb708bd56477850fbf1dd9e91 for the fix on CI 3.0.3

CI 3.0.4 will ship with the update for PHP 7 out of the box.

Thanks to https://github.com/narfbg