From:             mhaerry at c3om dot ch
Operating system: Linux RedHat EL 3
PHP version:      5.0.5
PHP Bug Type:     Session related
Bug description:  000 Permission on Session files

Description:
------------
Since around PHP 5.0.4 we are having a session save problem.

Most of the session files are stored correctly in seperate directories for
each virtual host. They have permission of 600 with the owner of the
running apache process. But there are from time to time session files
which are stored with Permission 000 like:

---
# find <pathtosessiondir> -perm 000 | xargs ls -lh
----------    1 nobody   4294967295        0 Nov  8 05:53
./<pathtosessiondir>/sess_dc3b60dc98b9ca7beba8f2afdf618df4
----------    1 nobody   4294967295       54 Nov  8 05:50
./<pathtosessiondir>/sess_122ad7d6c9c627cfa01201c4caf6520d
----------    1 nobody   4294967295       54 Nov  8 05:50
./<pathtosessiondir>/sess_1939034c40835c4946964eb0af25d14a
----------    1 nobody   4294967295       50 Nov  8 05:37
./<pathtosessiondir>/sess_353cecf3cd82bdb03092b0ceef89813c
----------    1 nobody   4294967295       54 Nov  8 05:51
./<pathtosessiondir>/sess_3cfab0c964ce99568520ca002dcdc015
----------    1 nobody   4294967295       54 Nov  8 05:50
./<pathtosessiondir>/sess_4ecf472d9c094634164ece1fea76bc8f
----------    1 nobody   4294967295       54 Nov  8 05:50
./<pathtosessiondir>/sess_56bd16f2d97c4705837d88b159df0de6
----------    1 nobody   4294967295       54 Nov  8 05:36
./<pathtosessiondir>/sess_61d36002c753af2301c361b3247775fa
----------    1 nobody   4294967295       54 Nov  8 05:34
./<pathtosessiondir>/sess_76e7794ad71b7c7ca30ee14d412d475b

etc.

---

so these session files can't be read anymore by php. it doesn't depend on
the application, we have this problem with every application from time to
time. and as it works sometimes and sometimes not within the same
application we don't think it has something to do with the umask setting.
so users can't login anymore etc. one solution is to delete these files as
root on the server (manually or in a script). the other is to tell the
users to delete the cookies and to restart their browsers. but anyway
these are only workarounds which won't fix the problem.

the session dirs aren't in /tmp/ and are also not on a tmpfs filesystem.
it's on the normal ext3 filesystem.

any ideas why this can happen and what we can do against that?

Reproduce code:
---------------
standard usage of session functions:

session_start();
$_SESSION['foo'] = 'bar';
[...]

session_destroy(); //while logging out

Expected result:
----------------
expected session files with permission 600

like:

-rw-------    1 nobody   4294967295     215K Nov  8 06:08
sess_9b50bc95e2a138ca376ff0b111d6d5a0

Actual result:
--------------
session files with permission 000:

----------    1 nobody   4294967295       54 Nov  8 05:34
./<pathtosessiondir>/sess_76e7794ad71b7c7ca30ee14d412d475b

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

Reply via email to