Bug #73245 [Opn->Ver]: session_start() doesn't start the session if headers have been sent
| From: | cmb@php.net | Date: | Wed, 05 Oct 2016 10:51:31 +0000 |
| Subject: | Bug #73245 [Opn->Ver]: session_start() doesn't start the session if headers have been sent | ||
| References: | 1 | Groups: | php.bugs |
| Request: | Send a blank email to php-bugs+get-204468@lists.php.net to get a copy of this message | ||
Edit report at https://bugs.php.net/bug.php?id=73245&edit=1
ID: 73245
Updated by: cmb@php.net
Reported by: php at duncanc dot co dot uk
Summary: session_start() doesn't start the session if headers
have been sent
-Status: Open
+Status: Verified
Type: Bug
Package: Session related
Operating System: Linux
PHP Version: 7.1.0RC3
-Assigned To:
+Assigned To: yohgaki
Block user comment: N
Private report: N
New Comment:
According to
git bisect the offending commit is
<https://github.com/php/php-src/commit/c200e8e1>.
Yasuo, can you please have a look at this issue.
Previous Comments:
------------------------------------------------------------------------
[2016-10-04 17:40:56] php at duncanc dot co dot uk
Description:
------------
In 7.0 and 5.6 calling session_start() even if headers have
been sent still made $_SESSION usable, but 7.1 changes this behaviour.
Test script:
---------------
session_start();
$_SESSION['blah'] = 'foo';
var_dump($_SESSION);
session_write_close();
session_start();
var_dump($_SESSION);
Expected result:
----------------
The dumped array should be the same both times:
array(1) {
["blah"]=>
string(3) "foo"
}
Actual result:
--------------
The second array dump is empty
------------------------------------------------------------------------
--
Edit this bug report at https://bugs.php.net/bug.php?id=73245&edit=1