Commit 17ea1c6
authored
Fix Redis session driver returning success on failed connection.
The open() method in Session_redis_driver returns $this->_success even when Redis::connect() fails (the else branch on a failed connection). This causes PHP's session_start() to believe the handler is ready, but subsequent read() calls fail, producing:
session_start(): Failed to read session data: user (path: /var/lib/php/sessions)
This was originally reported and fixed in the upstream bcit-ci/CodeIgniter repo:
Issue: bcit-ci#5779
PR: bcit-ci#5781
The fix was merged into CI3 for the 3.1.11 milestone but appears to have been lost when the 3.2.0-dev branch was created, which this fork is based on.
The fix changes the failed-connection else branch to log an error and fall through to return $this->_failure instead of incorrectly returning $this->_success.1 parent 6ff5717 commit 17ea1c6
1 file changed
Lines changed: 1 addition & 3 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
217 | 217 | | |
218 | 218 | | |
219 | 219 | | |
220 | | - | |
221 | | - | |
222 | | - | |
| 220 | + | |
223 | 221 | | |
224 | 222 | | |
225 | 223 | | |
| |||
0 commit comments