Bug #72599 [NEW]: Different behavior from 7.0 and below with multiple session_start()s and output

From: Date: Thu, 14 Jul 2016 20:51:58 +0000
Subject: Bug #72599 [NEW]: Different behavior from 7.0 and below with multiple session_start()s and output
Groups: php.bugs 
Request: Send a blank email to php-bugs+get-202335@lists.php.net to get a copy of this message
From: peehaa Operating system: PHP version: 7.1.0alpha3 Package: Session related Bug Type: Bug Bug description:Different behavior from 7.0 and below with multiple session_start()s and output 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 bug report at https://bugs.php.net/bug.php?id=72599&edit=1 -- Try a snapshot (PHP 5.4): https://bugs.php.net/fix.php?id=72599&r=trysnapshot54 Try a snapshot (PHP 5.5): https://bugs.php.net/fix.php?id=72599&r=trysnapshot55 Try a snapshot (trunk): https://bugs.php.net/fix.php?id=72599&r=trysnapshottrunk Fixed in SVN: https://bugs.php.net/fix.php?id=72599&r=fixed Fixed in release: https://bugs.php.net/fix.php?id=72599&r=alreadyfixed Need backtrace: https://bugs.php.net/fix.php?id=72599&r=needtrace Need Reproduce Script: https://bugs.php.net/fix.php?id=72599&r=needscript Try newer version: https://bugs.php.net/fix.php?id=72599&r=oldversion Not developer issue: https://bugs.php.net/fix.php?id=72599&r=support Expected behavior: https://bugs.php.net/fix.php?id=72599&r=notwrong Not enough info: https://bugs.php.net/fix.php?id=72599&r=notenoughinfo Submitted twice: https://bugs.php.net/fix.php?id=72599&r=submittedtwice register_globals: https://bugs.php.net/fix.php?id=72599&r=globals PHP 4 support discontinued: https://bugs.php.net/fix.php?id=72599&r=php4 Daylight Savings: https://bugs.php.net/fix.php?id=72599&r=dst IIS Stability: https://bugs.php.net/fix.php?id=72599&r=isapi Install GNU Sed: https://bugs.php.net/fix.php?id=72599&r=gnused Floating point limitations: https://bugs.php.net/fix.php?id=72599&r=float No Zend Extensions: https://bugs.php.net/fix.php?id=72599&r=nozend MySQL Configuration Error: https://bugs.php.net/fix.php?id=72599&r=mysqlcfg

« previous php.bugs (#202335) next »