Index: branches/5.2.x/core/kernel/session/session_storage.php =================================================================== diff -u -r16654 -r16793 --- branches/5.2.x/core/kernel/session/session_storage.php (.../session_storage.php) (revision 16654) +++ branches/5.2.x/core/kernel/session/session_storage.php (.../session_storage.php) (revision 16793) @@ -1,7 +1,7 @@ SetField($field_name, $field_value); } + // Reset change flags, because session is already saved to the database. + $this->ChangedDirectVars = array(); + // ensure user groups are stored in a way, that kPermissionsHelper::CheckUserPermission can understand $this->Session->StoreVar('UserGroups', $this->GetField('GroupList'), !$to_database); } @@ -254,6 +257,7 @@ if ( $replace != '' ) { $query = ' REPLACE INTO ' . $this->SessionDataTable . ' (' . $this->IDField . ', ' . $this->DataVarField . ', ' . $this->DataValueField . ') VALUES ' . $replace; $this->Conn->Query($query); + $this->OriginalData = $ses_data; } if ( $this->ChangedDirectVars ) { @@ -267,6 +271,7 @@ SET ' . implode(',', $changes) . ' WHERE ' . $this->IDField . ' = ' . $this->Conn->qstr($this->Session->GetID()); $this->Conn->Query($query); + $this->ChangedDirectVars = array(); } } Index: branches/5.2.x/core/units/helpers/user_helper.php =================================================================== diff -u -r16789 -r16793 --- branches/5.2.x/core/units/helpers/user_helper.php (.../user_helper.php) (revision 16789) +++ branches/5.2.x/core/units/helpers/user_helper.php (.../user_helper.php) (revision 16793) @@ -1,6 +1,6 @@ Application->StorePersistentVar('ThisLogin', adodb_mktime()); } + $this->Application->Session->SaveData(); + $hook_event = new kEvent('u:OnAfterLogin'); $hook_event->MasterEvent = $this->event; $this->Application->HandleEvent($hook_event);