#32739 [Opn->Bgs]: Call to session_start() causes script to prematurely terminate.
| From: | sniper@php.net | Date: | Mon, 18 Apr 2005 10:56:13 +0000 |
| Subject: | #32739 [Opn->Bgs]: Call to session_start() causes script to prematurely terminate. | ||
| References: | 1 | Groups: | php.bugs |
| Request: | Send a blank email to php-bugs+get-77770@lists.php.net to get a copy of this message | ||
ID: 32739
Updated by: sniper@php.net
Reported By: llgames at gmail dot com
-Status: Open
+Status: Bogus
Bug Type: Session related
Operating System: Windows XP Professional SP2
PHP Version: 5.0.4
New Comment:
Sorry, but your problem does not imply a bug in PHP itself. For a
list of more appropriate places to ask for help using PHP, please
visit http://www.php.net/support.php as this bug system
is not the
appropriate forum for asking support questions. Due to the volume
of reports we can not explain in detail here why your report is not
a bug. The support channels will be able to provide an explanation
for you.
Thank you for your interest in PHP.
Previous Comments:
------------------------------------------------------------------------
[2005-04-18 04:31:16] llgames at gmail dot com
Description:
------------
When running php 5.0.4 as a CGI module with Apache 2.0.51 a call to
session_start() after a location header will cause the script to
prematurely terminate. An error is not generated on screen or in the
server log files when this occurs. The session data from the first
script is being stored:
var1|s:11:"Hello World";
but it is not being retrieved by the second script.
Reproduce code:
---------------
script1.php
<?php
session_start();
$_SESSION['var1'] = 'Hello World';
header('Location: http://127.0.0.1/script2.php');
exit();
?>
script2.php
<?php
session_start();
print $_SESSION['var1'];
exit();
?>
Expected result:
----------------
One would expect to see "Hello World" appear in the browser window.
Actual result:
--------------
What happens is that the browser is greeted with either a blank page or
the browser simply displays the current page in the state before the
location header was recieved. No errors are being generated. Note that
using the computer's name or actual IP address in the location header
has no effect on the outcome of the two scripts. Manually calling the
second script also has no effect.
------------------------------------------------------------------------
--
Edit this bug report at http://bugs.php.net/?id=32739&edit=1