From:             ralph at smashlabs dot com
Operating system: Linux 2.6 series
PHP version:      5.1.4
PHP Bug Type:     Session related
Bug description:  session_regenerate_id() clashes with session.save_path

Description:
------------
I have not dug super deep into this problem but it seems as though if I
try to call session_regenerate_id() after having set session.save_path
with custom values, i get an error.  My guess is that
session_regenerate_id() is having issues with the save_path var. See rest
below:

Reproduce code:
---------------
This is my test script:

file: ../htdocs/test.php
<?

ini_set("session.save_path", ";666;../application/var/sessions");

session_start();

$id_before = session_id();

if ((++$_SESSION['counter'] % 5) == 0)
{
    session_regenerate_id(true);
}

echo "<pre>SESSION ID BEFORE: " . $id_before . "\n";
echo "SESSION ID AFTER : " . session_id();
echo "COUNTER          : " . $_SESSION['counter'];

?> 

Expected result:
----------------
The first 5 times it runs, it works fine... which means the file was
created with the proper permissions and at the proper location.

On the 5th run, I should not see any errors. Only the before and after
Session ID AND there should be a file in the directory with the old
session data... Counter should never start over.



Actual result:
--------------
SESSION ID BEFORE: 1e1469055dd81c95fb78aafde667639a
SESSION ID AFTER : a51b257a22da32065a0bef114abac7c7

COUNTER          : 5

Warning:  Unknown:
open(../application/var/sessions/sess_a51b257a22da32065a0bef114abac7c7,
O_RDWR) failed: No such file or directory (2) in Unknown on line 0



Warning:  Unknown: Failed to write session data (files). Please verify
that the current setting of session.save_path is correct
(;666;../application/var/sessions) in Unknown on line 0

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

Reply via email to