From:             llgames at gmail dot com
Operating system: Windows XP Professional SP2
PHP version:      5.0.4
PHP Bug Type:     Session related
Bug description:  Call to session_start() causes script to prematurely 
terminate.

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 bug report at http://bugs.php.net/?id=32739&edit=1
-- 
Try a CVS snapshot (php4):   http://bugs.php.net/fix.php?id=32739&r=trysnapshot4
Try a CVS snapshot (php5.0): 
http://bugs.php.net/fix.php?id=32739&r=trysnapshot50
Try a CVS snapshot (php5.1): 
http://bugs.php.net/fix.php?id=32739&r=trysnapshot51
Fixed in CVS:                http://bugs.php.net/fix.php?id=32739&r=fixedcvs
Fixed in release:            http://bugs.php.net/fix.php?id=32739&r=alreadyfixed
Need backtrace:              http://bugs.php.net/fix.php?id=32739&r=needtrace
Need Reproduce Script:       http://bugs.php.net/fix.php?id=32739&r=needscript
Try newer version:           http://bugs.php.net/fix.php?id=32739&r=oldversion
Not developer issue:         http://bugs.php.net/fix.php?id=32739&r=support
Expected behavior:           http://bugs.php.net/fix.php?id=32739&r=notwrong
Not enough info:             
http://bugs.php.net/fix.php?id=32739&r=notenoughinfo
Submitted twice:             
http://bugs.php.net/fix.php?id=32739&r=submittedtwice
register_globals:            http://bugs.php.net/fix.php?id=32739&r=globals
PHP 3 support discontinued:  http://bugs.php.net/fix.php?id=32739&r=php3
Daylight Savings:            http://bugs.php.net/fix.php?id=32739&r=dst
IIS Stability:               http://bugs.php.net/fix.php?id=32739&r=isapi
Install GNU Sed:             http://bugs.php.net/fix.php?id=32739&r=gnused
Floating point limitations:  http://bugs.php.net/fix.php?id=32739&r=float
No Zend Extensions:          http://bugs.php.net/fix.php?id=32739&r=nozend
MySQL Configuration Error:   http://bugs.php.net/fix.php?id=32739&r=mysqlcfg

Reply via email to