Index: branches/RC/core/kernel/session/session.php =================================================================== diff -u -N -r10780 -r10838 --- branches/RC/core/kernel/session/session.php (.../session.php) (revision 10780) +++ branches/RC/core/kernel/session/session.php (.../session.php) (revision 10838) @@ -397,7 +397,7 @@ var $Expiration; var $SID; - + var $SessionSet = false; /** @@ -415,7 +415,7 @@ * @var Params */ var $Data; - + /** * Names of optional session keys (which does not need to be always stored * @@ -493,7 +493,7 @@ if (!is_null($this->OriginalMode)) $this->SetMode($this->OriginalMode); } - + function ValidateExpired() { if( !(defined('IS_INSTALL') && IS_INSTALL) ) { @@ -502,7 +502,7 @@ $this->RemoveSessionCookie(); // true was here to force new session creation, but I used RemoveCookie a line above, to avoid redirect loop with expired sid not being removed // setSession with true was used before, to set NEW session cookie - $this->SetSession(); + $this->SetSession(); $this->Application->HandleEvent($event, 'u:OnSessionExpire'); return ; } @@ -628,7 +628,7 @@ $result = $this->LoadSession($sid); $this->SessionSet = $result; - + return $result; } @@ -734,7 +734,7 @@ $this->SID=$new_sid; $this->Application->SetVar($this->GETName,$new_sid); } - + function NeedSession() { $data = $this->Data->GetParams(); @@ -751,7 +751,7 @@ $this->GenerateSID(); return false; } - + if (!$this->SID || $force) $this->GenerateSID(); $this->Expiration = adodb_mktime() + $this->SessionTimeout; switch ($this->Mode) { @@ -820,7 +820,7 @@ $this->SetCookie($this->CookieName.'_live', $this->SID); $_COOKIE[$this->CookieName] = $this->SID; // for compatibility with in-portal } - + function RemoveSessionCookie() { $this->SetCookie($this->CookieName, ''); @@ -933,15 +933,10 @@ $last_template = basename($_SERVER['PHP_SELF']).'|'.mb_substr($last_env, mb_strlen(ENV_VAR_NAME) + 1); $this->StoreVar(rtrim('last_template_'.$wid, '_'), $last_template); + // prepare last_template for opener stack, module & session could be added later $last_env = $this->getLastTemplateENV($t, null, false); - $last_template = basename($_SERVER['PHP_SELF']).'|'.mb_substr($last_env, mb_strlen(ENV_VAR_NAME) + 1); - $this->StoreVar(rtrim('last_template_popup_'.$wid, '_'), $last_template); - // save other last... variables for mistical purposes (customizations may be) - $this->StoreVar('last_url', $_SERVER['REQUEST_URI']); // needed by ord:StoreContinueShoppingLink - $this->StoreVar('last_env', mb_substr($last_env, mb_strlen(ENV_VAR_NAME)+1)); - // save last_template in persistant session if (!$wid) { if ($this->Application->IsAdmin()) { @@ -971,6 +966,13 @@ $admin_session->StorePersistentVar('last_template_popup', '../'.$last_template); } } + + // save other last... variables for mistical purposes (customizations may be) + $this->StoreVar('last_url', $_SERVER['REQUEST_URI']); // needed by ord:StoreContinueShoppingLink + $this->StoreVar('last_env', mb_substr($last_env, mb_strlen(ENV_VAR_NAME)+1)); + + // save last template here, becase section & module could be added before + $this->StoreVar(rtrim('last_template_popup_'.$wid, '_'), $last_template); } function getLastTemplateENV($t, $params = null, $encode = true)