-
Notifications
You must be signed in to change notification settings - Fork 2k
Bug: memcached support broken for CI4 sessions #9940
Copy link
Copy link
Closed
Labels
bugVerified issues on the current code behavior or pull requests that will fix themVerified issues on the current code behavior or pull requests that will fix them
Description
PHP Version
8.4
CodeIgniter4 Version
4.7.0
CodeIgniter4 Installation Method
Composer (using codeigniter4/appstarter)
Which operating systems have you tested for this bug?
Linux
Which server did you use?
apache
Environment
production
Database
No response
What happened?
memcached support is broken in CI 4.7.0 because of the accidental change to this line:
| if ($this->savePath !== '') { |
It should be "
if ($this->savePath === '') {".
There was a commit done on 1/1/2026:
772eaf4
The original line was "if (empty($this->savePath)) {" new line is doing not empty which is not correct.
Steps to Reproduce
Upgrade to CI 4.7.0 and in your .env file set:
session.driver = 'CodeIgniter\Session\Handlers\MemcachedHandler'
session.expiration = 7200
session.savePath = 'localhost:11211'
Try and access CodeIgniter and it will say:
CodeIgniter\Session\Exceptions\SessionException
Session: No save path configured.
And the error points to:
66 if ($this->savePath !== '') {
67 throw SessionException::forEmptySavepath();
68 }
Expected Output
If we change "if ($this->savePath !== '') {" to "if ($this->savePath === '') {" in the MemcachedHandler.php then it works as expected.
Anything else?
No response
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
bugVerified issues on the current code behavior or pull requests that will fix themVerified issues on the current code behavior or pull requests that will fix them