"fixed problem of under some conditions not loaded adodb classes for php4-restore"

This commit is contained in:
Ralf Becker 2008-07-29 12:13:07 +00:00
parent 57293bca75
commit ac38fe77ff

View File

@ -24,9 +24,12 @@
*/
class sessions extends sessions_
{
var $save_session_vars_start;
function sessions($domain_names=null)
{
$this->save_session_vars_start = $_SESSION; // store already set session vars
$this->sessions_($domain_names);
//controls the time out for php4 sessions - skwashd 18-May-2003
ini_set('session.gc_maxlifetime', $GLOBALS['egw_info']['server']['sessions_timeout']);
@ -38,7 +41,8 @@
*
* @return bool
*/
function commit_session() {
function commit_session()
{
session_write_close();
return true;
}
@ -81,7 +85,16 @@
function register_session($login,$user_ip,$now,$session_flags)
{
// session_start() is now called in new_session_id() !!!
// restore session vars set before session was started
if ($this->save_session_vars_start && is_array($this->save_session_vars_start))
{
foreach($this->save_session_vars_start as $name => &$value)
{
//error_log(__METHOD__."() added $name=".array2string($value));
$_SESSION[$name] =& $value;
}
unset($this->save_session_vars_start);
}
$_SESSION[EGW_SESSION_VAR]['session_id'] = $this->sessionid;
$_SESSION[EGW_SESSION_VAR]['session_lid'] = $login;
$_SESSION[EGW_SESSION_VAR]['session_ip'] = $user_ip;