Skip to content

Commit ee2f76e

Browse files
bug symfony#27632 [HttpFoundation] Ensure RedisSessionHandler::updateTimestamp returns a boolean (MatTheCat)
This PR was merged into the 4.1 branch. Discussion ---------- [HttpFoundation] Ensure RedisSessionHandler::updateTimestamp returns a boolean | Q | A | ------------- | --- | Branch? | 4.1 | Bug fix? | yes | New feature? | no | BC breaks? | no | Deprecations? | no | Tests pass? | yes | License | MIT Since v1.1.0 predis doesn't return the result of `EXPIRE` as a boolean, thus breaking `updateTimestamp` implementation. Maybe it's worth mentioning error messages were useless here: - Symfony: `User Warning: session_write_close(): Failed to write session data with Symfony\Component\HttpFoundation\Session\Storage\Handler\RedisSessionHandler handler` - PHP: `session_write_close(): Session callback expects true/false return value` Commits ------- 079b944 Ensure updateTimestamp returns a boolean
2 parents 15c0d48 + 079b944 commit ee2f76e

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

src/Symfony/Component/HttpFoundation/Session/Storage/Handler/RedisSessionHandler.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -100,6 +100,6 @@ public function gc($maxlifetime): bool
100100
*/
101101
public function updateTimestamp($sessionId, $data)
102102
{
103-
return $this->redis->expire($this->prefix.$sessionId, (int) ini_get('session.gc_maxlifetime'));
103+
return (bool) $this->redis->expire($this->prefix.$sessionId, (int) ini_get('session.gc_maxlifetime'));
104104
}
105105
}

0 commit comments

Comments
 (0)