#39619 [NEW]: custom session save handler looses current directory

From: Date: Fri, 24 Nov 2006 14:59:18 +0000
Subject: #39619 [NEW]: custom session save handler looses current directory
Groups: php.bugs 
Request: Send a blank email to php-bugs+get-105412@lists.php.net to get a copy of this message
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

« previous php.bugs (#105412) next »