Bug #72599 [Opn->Wfx]: Different behavior from 7.0 and below with multiple session_start()s and output
| From: | yohgaki@php.net | Date: | Sat, 27 Aug 2016 06:50:38 +0000 |
| Subject: | Bug #72599 [Opn->Wfx]: Different behavior from 7.0 and below with multiple session_start()s and output | ||
| References: | 1 | Groups: | php.bugs |
| Request: | Send a blank email to php-bugs+get-203604@lists.php.net to get a copy of this message | ||
Edit report at https://bugs.php.net/bug.php?id=72599&edit=1
ID: 72599
Updated by: yohgaki@php.net
Reported by: peehaa@php.net
Summary: Different behavior from 7.0 and below with multiple
session_start()s and output
-Status: Open
+Status: Wont fix
Type: Bug
Package: Session related
PHP Version: 7.1.0alpha3
Block user comment: N
Private report: N
New Comment:
Behavior would not be fixed because starting session when it is impossible to start correctly is a
bug of session manager. i.e. There is no point running script with unusable $_SESSION array.
Previous Comments:
------------------------------------------------------------------------
[2016-07-14 20:51:57] peehaa@php.net
Description:
------------
It seems like the behavior of starting a session has changed between < 7.1 and 7.1.
I'm not sure whether this is intentional (I couldn't find any mention of it in NEWS or
UPGRADING or I just overlooked it).
When trying to start a session twice while the headers have already been sent I get:
Notice: A session had already been started - ignoring session_start() in /in/itgeJ on line 5
on the second session_start() call on 7.0 (and below), but on 7.1 I get:
Warning: session_start(): Cannot send session cookie - headers already sent by
Warning: session_start(): Cannot send session cache limiter - headers already sent (output started
at /in/itgeJ:2) in /in/itgeJ on line 5
on the second session_start() call.
Test script: https://3v4l.org/NXiYR
Test script:
---------------
output
<?php
session_start();
session_start();
Expected result:
----------------
Warning: session_start(): Cannot send session cookie - headers already sent by (output started at
/in/NXiYR:2) in /in/NXiYR on line 4
Warning: session_start(): Cannot send session cache limiter - headers already sent (output started
at /in/NXiYR:2) in /in/NXiYR on line 4
Notice: A session had already been started - ignoring session_start() in /in/NXiYR on line 5
Actual result:
--------------
output
Warning: session_start(): Cannot send session cookie - headers already sent by (output started at
/in/NXiYR:2) in /in/NXiYR on line 4
Warning: session_start(): Cannot send session cache limiter - headers already sent (output started
at /in/NXiYR:2) in /in/NXiYR on line 4
Warning: session_start(): Cannot send session cookie - headers already sent by (output started at
/in/NXiYR:2) in /in/NXiYR on line 5
Warning: session_start(): Cannot send session cache limiter - headers already sent (output started
at /in/NXiYR:2) in /in/NXiYR on line 5
------------------------------------------------------------------------
--
Edit this bug report at https://bugs.php.net/bug.php?id=72599&edit=1