Date: 06/14/01
- Next message: kalowsky <email protected>: "[PHP-DEV] Bug #10446 Updated: Invalid server response from syntax error"
- Previous message: kalowsky <email protected>: "[PHP-DEV] Bug #11104 Updated: module slowly kills server"
- Next in thread: sniper <email protected>: "[PHP-DEV] Bug #11367 Updated: changing of current directory to "/" when session is to be saved"
- Maybe reply: sniper <email protected>: "[PHP-DEV] Bug #11367 Updated: changing of current directory to "/" when session is to be saved"
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
ID: 11367
User Update by: alex <email protected>
Status: Bogus
Bug Type: *Session related
Operating system: OS/2
PHP Version: 4.0.5
Description: changing of current directory to "/" when session is to be saved
1. This example is based on the one from PHP Manual.
So, you probably should fix the manual.
2. Originally "sess_" was there. But there was no difference.
3. "log" was made only for loggin'. The basis of the bug is that two(!) log files are created, one in current dir, another in the root, but there is no manual directory changing in my example!
Previous Comments:
---------------------------------------------------------------------------
[2001-06-14 13:48:28] sniper <email protected>
This example of yours is bogus.
1. you should prefix the func names with, e.g. sess_
2. you can't use same file to logging and storing session data. Session file has to be unique for each session.
---------------------------------------------------------------------------
[2001-06-08 15:55:52] alex <email protected>
===cut===
<?php
function open ($save_path, $session_name) {
$f = fopen('log', 'a');
fputs($f, "open ($save_path, $session_name)n");
fclose($f);
return true;
}
function close() {
$f = fopen('log', 'a');
fputs($f, "closen");
fclose($f);
return true;
}
function read ($key) {
$f = fopen('log', 'a');
fputs($f, "read ($key)n");
fclose($f);
return "foo|i:1;";
}
function write ($key, $val) {
$f = fopen('log', 'a');
fputs($f, "write ($key, $val)n");
fclose($f);
return true;
}
function destroy ($key) {
$f = fopen('log', 'a');
fputs($f, "destroy($key)n");
fclose($f);
return true;
}
function gc ($maxlifetime) {
return true;
}
session_set_save_handler ("open", "close", "read", "write", "destroy", "gc");
session_start();
$foo++;
?>
===cut===
-this will produce one "log" in the document-root directory and another in the root dir.
---------------------------------------------------------------------------
Full Bug description available at: http://bugs.php.net/?id=11367
-- PHP Development Mailing List <http://www.php.net/> To unsubscribe, e-mail: php-dev-unsubscribe <email protected> For additional commands, e-mail: php-dev-help <email protected> To contact the list administrators, e-mail: php-list-admin <email protected>
- Next message: kalowsky <email protected>: "[PHP-DEV] Bug #10446 Updated: Invalid server response from syntax error"
- Previous message: kalowsky <email protected>: "[PHP-DEV] Bug #11104 Updated: module slowly kills server"
- Next in thread: sniper <email protected>: "[PHP-DEV] Bug #11367 Updated: changing of current directory to "/" when session is to be saved"
- Maybe reply: sniper <email protected>: "[PHP-DEV] Bug #11367 Updated: changing of current directory to "/" when session is to be saved"
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]

