Index: trunk/core/kernel/session/session.php =================================================================== diff -u -N -r8402 -r8593 --- trunk/core/kernel/session/session.php (.../session.php) (revision 8402) +++ trunk/core/kernel/session/session.php (.../session.php) (revision 8593) @@ -276,28 +276,28 @@ // -2 (when not logged in), false (when after u:OnLogout event) return ; } - + $this->PersistentVars[$var_name] = $var_value; - + $key_clause = 'PortalUserId = '.$user_id.' AND VariableName = '.$this->Conn->qstr($var_name); - + $sql = 'SELECT VariableValue FROM '.TABLE_PREFIX.'PersistantSessionData WHERE '.$key_clause; $record_found = $this->Conn->GetOne($sql); - + $fields_hash = Array ( 'PortalUserId' => $user_id, 'VariableName' => $var_name, 'VariableValue' => $var_value, ); - + if ($record_found) { $this->Conn->doUpdate($fields_hash, TABLE_PREFIX.'PersistantSessionData', $key_clause); } else { - $this->Conn->doInsert($fields_hash, TABLE_PREFIX.'PersistantSessionData'); - } + $this->Conn->doInsert($fields_hash, TABLE_PREFIX.'PersistantSessionData'); + } } function RecallPersistentVar(&$session, $var_name, $default = false) @@ -671,16 +671,16 @@ break; } $this->Storage->StoreSession($this); - + if ($this->Application->IsAdmin() || $this->Special == 'admin') { $this->StoreVar('admin', 1); } - + if ($this->Special != '') { // front-session called from admin or otherwise, then save it's data $this->SaveData(); } - + $this->Application->resetCounters('UserSession'); } @@ -806,7 +806,7 @@ // 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', substr($last_env, strlen(ENV_VAR_NAME)+1)); - + // save last_template in persistant session if (!$wid) { if ($this->Application->IsAdmin()) { @@ -819,15 +819,19 @@ break; } } - + if (!$temp_mode) { + if (isset($this->Application->HttpQuery->Get['section'])) { + // check directly in GET, bacause LinkVar (session -> request) used on these vars + $last_template .= '§ion='.$this->Application->GetVar('section').'&module='.$this->Application->GetVar('module'); + } $this->StorePersistentVar('last_template_popup', $last_template); } } elseif ($this->Application->GetVar('admin') == 1) { $admin_session =& $this->Application->recallObject('Session.admin'); /* @var $admin_ses Session */ - + $admin_session->StorePersistentVar('last_template_popup', '../'.$last_template); } } @@ -838,7 +842,7 @@ $params['__URLENCODE__'] = 1; return $this->Application->BuildEnv($t, $params, 'all'); } - + function StoreVar($name, $value) { $this->Data->Set($name, $value); @@ -874,7 +878,7 @@ return $this->Storage->RecallPersistentVar($this, $name, $default); } - + function RemoveVar($name) { $this->Storage->RemoveFromData($this, $name); @@ -916,7 +920,7 @@ { return $this->Storage->DeleteExpired(); } - + /** * Allows to check if user in this session is logged in or not *