Index: branches/5.0.x/core/kernel/session/inp_session.php =================================================================== diff -u -r12343 -r12368 --- branches/5.0.x/core/kernel/session/inp_session.php (.../inp_session.php) (revision 12343) +++ branches/5.0.x/core/kernel/session/inp_session.php (.../inp_session.php) (revision 12368) @@ -1,6 +1,6 @@ SessionTimeout = $this->Application->ConfigValue('SessionTimeout'); $path = (BASE_PATH == '') ? '/' : BASE_PATH; -// if ( $this->Application->IsAdmin() ) $path = rtrim($path, '/').'/admin'; $this->SetCookiePath($path); $cookie_name = $this->Application->ConfigValue('SessionCookieName'); - if (!$cookie_name) $cookie_name = 'sid'; - if (($this->Application->IsAdmin() && $special !== 'front') || $special == 'admin' ) { // || $this->Application->GetVar('admin') == 1 - $cookie_name = 'adm_'.$cookie_name; + if (!$cookie_name) { + $cookie_name = 'sid'; } + + $admin_session = ($this->Application->IsAdmin() && $special !== 'front') || ($special == 'admin'); + + if ($admin_session) { + $cookie_name = 'adm_' . $cookie_name; + } + $this->SetCookieName($cookie_name); $this->SetCookieDomain(SERVER_NAME); - if( $this->Application->IsAdmin()) { // && $this->Application->GetVar('admin') != 1 + if ($admin_session) { $mode = smAUTO; } - elseif (constOn('IS_INSTALL')) { + elseif (defined('IS_INSTALL') && IS_INSTALL) { $mode = smCOOKIES_ONLY; } else { $ses_mode = $this->Application->ConfigValue('CookieSessions'); + if ($ses_mode == 2) $mode = smAUTO; if ($ses_mode == 1) $mode = smCOOKIES_ONLY; if ($ses_mode == 0) $mode = smGET_ONLY; } + $this->SetMode($mode); - parent::Init($prefix,$special); + parent::Init($prefix, $special); - if( !$this->Application->IsAdmin() && $this->GetField('PortalUserId') <= 0 ) - { + if (!$this->Application->IsAdmin() && $this->GetField('PortalUserId') <= 0) { $group_list = $this->Application->ConfigValue('User_GuestGroup').','.$this->Application->ConfigValue('User_LoggedInGroup'); $this->SetField('GroupId', $this->Application->ConfigValue('User_GuestGroup')); $this->SetField('GroupList', $group_list); @@ -63,8 +69,12 @@ $this->Storage->DeleteEditTables(); $this->Data = new Params(); $this->SID = $this->CachedSID = ''; - if ($this->CookiesEnabled) $this->SetSessionCookie(); //will remove the cookie due to value (sid) is empty +// if ($this->CookiesEnabled) { + // remove cookie, because we will have fake session and it should be getting sid left in cookies + $this->SetSessionCookie(); //will remove the cookie due to value (sid) is empty +// } + $this->SetSession(); //will create a new session }