php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #75308 Defining a session handler breaks the session
Submitted: 2017-10-03 15:21 UTC Modified: 2019-01-27 09:56 UTC
Votes:2
Avg. Score:5.0 ± 0.0
Reproduced:2 of 2 (100.0%)
Same Version:1 (50.0%)
Same OS:1 (50.0%)
From: loranger at free dot fr Assigned:
Status: Not a bug Package: Session related
PHP Version: 7.1.10 OS: Debian-docker
Private report: No CVE-ID: None
 [2017-10-03 15:21 UTC] loranger at free dot fr
Description:
------------
While trying to make my legacy code working with a brand new PHP 7.1 using debian, I discovered that defining a session handler breaks the sessions a,nd throw the following warning: 

“Warning: session_start(): Failed to read session data: user (path: )”

I tried with an empty session_handler, using php 7.0 in order to identify the source of the problem: It worked.

As soon as I upgrade to 7.1 (or 7.2 RC), my sessions stop working.

Test script:
---------------
https://gist.github.com/loranger/f57ce97e1a60d7d106835f07918f85f9

Actual result:
--------------
 Warning: session_start(): Failed to read session data: user (path: ) in index.php on line 49

Patches

Add a Patch

Pull Requests

Add a Pull Request

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2019-01-27 09:56 UTC] yohgaki@php.net
-Status: Open +Status: Not a bug
 [2019-01-27 09:56 UTC] yohgaki@php.net
Session module was accepting invalid values, including save handlers.
You must return "string" for successful read.
 
PHP Copyright © 2001-2024 The PHP Group
All rights reserved.
Last updated: Fri Apr 19 12:01:27 2024 UTC