diff --git a/framework/CHANGELOG.md b/framework/CHANGELOG.md index d16d1e4..6297e33 100644 --- a/framework/CHANGELOG.md +++ b/framework/CHANGELOG.md @@ -14,6 +14,7 @@ Yii Framework 2 Change Log - Bug #19204: Support numbers in Inflector::camel2words (longthanhtran) - Bug #19004: Container::resolveCallableDependencies() unable to handle union and intersection types (sartor) - Bug #19047: Fix deprecated preg_match() passing null parameters #2 in db\mysql\Schema.php (longthanhtran) +- Bug #19130: Fix DbSession breaks in some case (longthanhtran) 2.0.44 December 30, 2021 diff --git a/framework/web/DbSession.php b/framework/web/DbSession.php index d82484a..73a29bf 100644 --- a/framework/web/DbSession.php +++ b/framework/web/DbSession.php @@ -140,7 +140,7 @@ class DbSession extends MultiFieldSession ->queryOne(); }); - if ($row !== false) { + if ($row !== false && $this->getIsActive()) { if ($deleteOldSession) { $this->db->createCommand() ->update($this->sessionTable, ['id' => $newID], ['id' => $oldID]) @@ -151,11 +151,6 @@ class DbSession extends MultiFieldSession ->insert($this->sessionTable, $row) ->execute(); } - } else { - // shouldn't reach here normally - $this->db->createCommand() - ->insert($this->sessionTable, $this->composeFields($newID, '')) - ->execute(); } }