#38085 [Asn->Fbk]: session_regenerate_id() clashes with session.save_path
ID: 38085
Updated by: iliaa@php.net
Reported By: ralph at smashlabs dot com
-Status: Assigned
+Status: Feedback
Bug Type: Session related
Operating System: Linux 2.6 series
PHP Version: 5.1.4
Assigned To: sas
New Comment:
Please try using this CVS snapshot:
http://snaps.php.net/php5.2-latest.tar.gz
For Windows:
http://snaps.php.net/win32/php5.2-win32-latest.zip
Works fine in latest cvs, even with 10 runs.
Have you tried changing ../application/var/sessions to a full
path?
Previous Comments:
------------------------------------------------------------------------
[2006-07-12 21:59:44] ralph at smashlabs dot com
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 this bug report at http://bugs.php.net/?id=38085&edit=1
Thread (6 messages)