|
php.net | support | documentation | report a bug | advanced search | search howto | statistics | random bug | login |
PatchesPull RequestsHistoryAllCommentsChangesGit/SVN commits
[2005-04-18 12:56 UTC] sniper@php.net
|
|||||||||||||||||||||||||||
Copyright © 2001-2025 The PHP GroupAll rights reserved. |
Last updated: Sat Oct 25 18:00:02 2025 UTC |
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.