Bug #11367 Updated: changing of current directory to "/" when session is to be saved
| From: | sniper@php.net | Date: | Thu, 14 Jun 2001 17:48:29 +0000 |
| Subject: | Bug #11367 Updated: changing of current directory to "/" when session is to be saved | ||
| Groups: | php.dev | ||
| Request: | Send a blank email to php-dev+get-57153@lists.php.net to get a copy of this message | ||
ID: 11367
Updated by: sniper
Reported By: alex@gai.ru
Old-Status: Open
Status: Bogus
Bug Type: *Session related
Operating system:
PHP Version: 4.0.5
Assigned To:
Comments:
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.
Previous Comments:
---------------------------------------------------------------------------
[2001-06-08 15:55:52] alex@gai.ru
===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.
---------------------------------------------------------------------------
ATTENTION! Do NOT reply to this email!
To reply, use the web interface found at http://bugs.php.net/?id=11367&edit=2