ID: 11367
User Update by: [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] [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] [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: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]

Reply via email to