From: thbley at gmail dot com
Operating system: WinXP SP2
PHP version: 5.2.0
PHP Bug Type: *General Issues
Bug description: custom session save handler looses current directory
Description:
------------
I'm using a custom session save handler. When the write function is
called, the current directory is changed to the apache bin directory. This
breaks when using relative paths for storing session data.
Reproduce code:
---------------
session_set_save_handler("none","none","read","write","none","none");
session_start();
echo "2 ".getcwd()."<br>";
function none() {
return true;
}
function read($id) {
echo "1 ".getcwd()."<br>";
}
function write($id,$val) {
echo "3 ".getcwd()."<br>";
}
Expected result:
----------------
1 H:\sgs\src
Warning: session_start() [function.session-start]: Cannot send session
cache limiter - headers already sent (output started at
H:\sgs\src\test_session.php:14) in H:\sgs\src\test_session.php on line 5
2 H:\sgs\src
3 H:\sgs\src
Actual result:
--------------
1 H:\sgs\src
Warning: session_start() [function.session-start]: Cannot send session
cache limiter - headers already sent (output started at
H:\sgs\src\test_session.php:14) in H:\sgs\src\test_session.php on line 5
2 H:\sgs\src
3 H:\Development\Apache2_php5\bin
--
Edit bug report at http://bugs.php.net/?id=39619&edit=1
--
Try a CVS snapshot (PHP 4.4):
http://bugs.php.net/fix.php?id=39619&r=trysnapshot44
Try a CVS snapshot (PHP 5.2):
http://bugs.php.net/fix.php?id=39619&r=trysnapshot52
Try a CVS snapshot (PHP 6.0):
http://bugs.php.net/fix.php?id=39619&r=trysnapshot60
Fixed in CVS: http://bugs.php.net/fix.php?id=39619&r=fixedcvs
Fixed in release:
http://bugs.php.net/fix.php?id=39619&r=alreadyfixed
Need backtrace: http://bugs.php.net/fix.php?id=39619&r=needtrace
Need Reproduce Script: http://bugs.php.net/fix.php?id=39619&r=needscript
Try newer version: http://bugs.php.net/fix.php?id=39619&r=oldversion
Not developer issue: http://bugs.php.net/fix.php?id=39619&r=support
Expected behavior: http://bugs.php.net/fix.php?id=39619&r=notwrong
Not enough info:
http://bugs.php.net/fix.php?id=39619&r=notenoughinfo
Submitted twice:
http://bugs.php.net/fix.php?id=39619&r=submittedtwice
register_globals: http://bugs.php.net/fix.php?id=39619&r=globals
PHP 3 support discontinued: http://bugs.php.net/fix.php?id=39619&r=php3
Daylight Savings: http://bugs.php.net/fix.php?id=39619&r=dst
IIS Stability: http://bugs.php.net/fix.php?id=39619&r=isapi
Install GNU Sed: http://bugs.php.net/fix.php?id=39619&r=gnused
Floating point limitations: http://bugs.php.net/fix.php?id=39619&r=float
No Zend Extensions: http://bugs.php.net/fix.php?id=39619&r=nozend
MySQL Configuration Error: http://bugs.php.net/fix.php?id=39619&r=mysqlcfg