Session handler could return NULL instead of empty string

Created on 20 March 2018, over 7 years ago
Updated 20 December 2018, almost 7 years ago

After switching to PHP 7.1 we found that lots of users could not log in and the log was full of messages like "session_start(): Failed to read session data: user" pointing to wincache-session.code.inc.

After a quick Stack Overflow search I found that SessionHandler::read() has to return a string.

I'm not sure if the WincacheSessionHandler::read() is ever supposed to get to the last return statement and what caused it to get to it after the upgrade, but changing it to return an empty string fixed the issue.

πŸ› Bug report
Status

Needs review

Version

1.0

Component

Code

Created by

Live updates comments and jobs are added and updated live.
Sign in to follow issues

Comments & Activities

Not all content is available!

It's likely this issue predates Contrib.social: some issue and comment data are missing.

  • πŸ‡ΊπŸ‡ΈUnited States matpiet

    This worked for me. I just updated this module in 2024 and the code is still return NULL out of the box. Not sure why this isn't in the source code at this point.

Production build 0.71.5 2024