php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #7477 Session Write Failure
Submitted: 2000-10-26 05:00 UTC Modified: 2000-10-28 17:40 UTC
From: tim dot parkin at didio dot com Assigned: alex@zend.com (profile)
Status: Closed Package: Session related
PHP Version: 4.0.3 OS: Solaris 8
Private report: No CVE-ID: None
Welcome back! If you're the original bug submitter, here's where you can edit the bug or add additional notes.
If you forgot your password, you can retrieve your password here.
Password:
Status:
Package:
Bug Type:
Summary:
From: tim dot parkin at didio dot com
New email:
PHP Version: OS:

 

 [2000-10-26 05:00 UTC] tim dot parkin at didio dot com
I am having major problems getting a custom session handler (oci8 based) to work in php-4.0.2 and php-4.0.3. I have set session.save_handler=user in the php.ini file and it registers in phpinfo(). I have also set the module_name specifically using : 

session_module_name('user'); 

The problem is that the write function does not work. I have seen many posts showing the same problem (admittedly some of them are a result of not setting save_handler) and as yet have found no 'official' response. 

This seems to have been around since 4.0.1pl2. 

I have tried printing from the write function and also writing to a file whilst presuming that the session write is not called till after the page has finished processing. 

This is a major blow to a project we are working on. We can find ways around this but it has knocked our confidence in PHP somewhat. 

A prompt reply would be greatly appreciated. 

dev environment

Sun Sparce Ultra 5

Solaris 8

APACHE-1.3.12
./configure --with-layout=Apache --prefix=/usr/local/apache --enable-module=so --enable-module=rewrite --enable-module=log_referer --enable-module=info --enable-module=status --add-module=src/modules/standard/mod_rewrite.c --add-module=src/modules/standard/mod_log_referer.c --add-module=src/modules/standard/mod_info.c --add-module=src/modules/standard/mod_status.c --enable-shared=max --server-uid=oracle --server-gid=dba

PHP-4.0.2
./configure  --with-apxs=/usr/local/apache/bin/apxs --enable-track-vars=yes --enable-bcmatch=yes --enable-memory-limit=yes --enable-magic-quotes=yes --enable-trans-sid=yes --enable-nodebug=yes --with-oci8=$ORACLE_HOME/lib--with-oracle=$ORACLE_HOME/lib --without-mysql --enable-libgcc


Tim Parkin 
Web Development Manager 
Didio Communications 

oci_session_handler is avaialable on request although the normal test handler fails to write also ie..

<?php 
function open ($save_path, $session_name) { 
echo "open ($save_path, $session_name)\n"; 
return true; 
} 
function close () { 
echo "close\n"; 
return true; 
} 
function read ($key) { 
echo "read ($key)\n"; 
return "foo|i:1;"; 
} 
function write ($key, $val) { 
echo "write ($key, $val)\n"; 
// Test to see if output to page is failing due to write being executed after user output is finished
$fp = fopen("temp",w);
fwrite($fp,"write ($key, $val)",4096);
fclose($fp);
return true; 
} 
function destroy ($key) { 
return true; 
} 
function gc ($maxlifetime) { 
return true; 
} 

session_set_save_handler ("open", "close", "read", "write", "destroy", "gc"); 
?>

Thanks

php.ini

;;;;;;;;;;;;;;;;;
; Data Handling ;
;;;;;;;;;;;;;;;;;
variables_order = "EGPCS" 
register_globals = On
register_argc_argv = On
track_vars = On
gpc_order = "GPC"
; Magic quotes
magic_quotes_gpc =  On
magic_quotes_runtime = On
magic_quotes_sybase  = Off

; automatically add files before or after any PHP document
auto_prepend_file =
auto_append_file =

Patches

Pull Requests

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2000-10-26 08:20 UTC] tim dot parkin at didio dot com
Ater posting this I removed the session_module command and it started working... I am going to try replicating this behaviour on my home system and report here on my findings..

Tim Parkin

 [2000-10-28 17:40 UTC] sasha@php.net
The text below should be added to the documentation of the session extension:

"The session_module() with a parameter destroys the current session and overwrites the values of the user handlers if such are set with the session_set_save_handler() function. Basically, session_module with a parameter should be invoked in the beginning of the script, before any of the session_set_handlers() or session_start() functions."
 
PHP Copyright © 2001-2025 The PHP Group
All rights reserved.
Last updated: Sat Jul 12 05:01:33 2025 UTC