php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #27478 PHP doesn't wait for the child to finish execution!
Submitted: 2004-03-03 05:24 UTC Modified: 2004-03-03 06:49 UTC
Votes:1
Avg. Score:5.0 ± 0.0
Reproduced:0 of 0 (0.0%)
From: sambukkaa at hotmail dot com Assigned:
Status: Not a bug Package: Scripting Engine problem
PHP Version: 5.0.0b4 (beta4) OS: Windows
Private report: No CVE-ID: None
 [2004-03-03 05:24 UTC] sambukkaa at hotmail dot com
Description:
------------
PHP doesn't wait for the child to finish execution but incase of sessions it is critical.
To test it you need to create 2 files as followed:

file 1: main.php
file 2: sub.php


Reproduce code:
---------------
file 1: main.php
<html><head><title>file name: main.php</title></head><body>
<?$_SESSION['var']=1;
"echo The session variable ist set to ". $_SESSION['var'] ."</br>";?>
<p><a href="sub.php" target="_blank"">call the sub.php file that opens the session variable &quot;var&quot; with the  value 1, but:</a>
<?// PHP doesn't wait for the child to finish execution!
$_SESSION['var']=0;?>
</body>
</html>
file 2: sub.php
<?$text="You have opened the sub.php file, receiving a session variable 'var' which shuld have the value of 1 but  _SESSION['var']=". $_SESSION['var'];
echo $text;?>

Expected result:
----------------
It MUST show the real value (1) before changing it to 0. you can test it on my server too: http://motion4u.sytes.net/phptest/main.php 


Patches

Pull Requests

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2004-03-03 06:49 UTC] derick@php.net
Thank you for taking the time to write to us, but this is not
a bug. Please double-check the documentation available at
http://www.php.net/manual/ and the instructions on how to report
a bug at http://bugs.php.net/how-to-report.php

Use session_write_close() after you set the session variable to flush out the data.
 
PHP Copyright © 2001-2024 The PHP Group
All rights reserved.
Last updated: Thu Oct 17 21:01:27 2024 UTC