php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #28308 Zero length session files in /tmp
Submitted: 2004-05-07 02:13 UTC Modified: 2004-07-01 06:12 UTC
From: lee dot stewart at attglobal dot net Assigned:
Status: Closed Package: Session related
PHP Version: 4.3.4 OS: SuSE SLES8 on IBM mainframe
Private report: No CVE-ID: None
 [2004-05-07 02:13 UTC] lee dot stewart at attglobal dot net
Description:
------------
Hi...

I have a script that runs on other platforms, but I can't get it to work on this platform.  (I suspect it's not a PHP code bug, but haven't been able to find a problem in the setup or anything I've done.) 

The problem is that PHP creates a sess... file in /tmp (which is global read/write/execute), but the file ALWAYS has zero bytes, which of course means the next screen fails becuase it can't get it's assumed data...

The code below is a truly trivial test case which fails.  The test case also fails the same way with the new style session support. (The full application is quite large and it's not reasonable to go convert the entire application to the new style.)  The code does the same with or without a session_write_close() call.

The "real" code runs on a PHP 4.3.4 system that's not net accessible.  But the code fails the same on a similar (SuSE SLES8 on and IBM mainframe with PHP 4.2.2) system that is web accessible.  You can run the test for yourself at www.sytek-services.com/page1.php.  And you can also see the PHP Info page for that system at www.sytek-services.com/phpinfo.php.

Like I said, I suspect it's something in the setup, but I've not been able to find out what...   Thanks for any help or pointers...
Lee Stewart

Reproduce code:
---------------
page1.php:
<?
session_start();
$test='foobar';
session_register('test');
$test='fooey';
header('Location: page2.php');
?>

page2.php:
<?
session_start();
echo "test is $test<br>";
?>

Expected result:
----------------
test is fooey

Actual result:
--------------
test is

Patches

Add a Patch

Pull Requests

Add a Pull Request

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2004-05-07 17:54 UTC] iliaa@php.net
Does your /tmp partition/directory have free space? 
 [2004-05-07 18:20 UTC] lee dot stewart at attglobal dot net
Yes, the /tmp directory is in a filesystem that's about 75% full...
Lee
 [2004-07-01 06:12 UTC] lee dot stewart at attglobal dot net
Sorry for the delay...   The application got moved to a different platform before I could get system time to install and test the snapshot recommended.
 
PHP Copyright © 2001-2024 The PHP Group
All rights reserved.
Last updated: Thu Apr 25 18:02:40 2024 UTC