php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #32739 Call to session_start() causes script to prematurely terminate.
Submitted: 2005-04-18 04:31 UTC Modified: 2005-04-18 12:56 UTC
From: llgames at gmail dot com Assigned:
Status: Not a bug Package: Session related
PHP Version: 5.0.4 OS: Windows XP Professional SP2
Private report: No CVE-ID: None
View Add Comment Developer Edit
Welcome! If you don't have a Git account, you can't do anything here.
You can add a comment by following this link or if you reported this bug, you can edit this bug over here.
(description)
Block user comment
Status: Assign to:
Package:
Bug Type:
Summary:
From: llgames at gmail dot com
New email:
PHP Version: OS:

 

 [2005-04-18 04:31 UTC] 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.

Patches

Add a Patch

Pull Requests

Add a Pull Request

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2005-04-18 12:56 UTC] sniper@php.net
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.


 
PHP Copyright © 2001-2024 The PHP Group
All rights reserved.
Last updated: Thu May 16 10:01:31 2024 UTC