Browse Source

Fix #19130: Fix DbSession breaks in some case

tags/2.0.45
Long TRAN 3 years ago committed by GitHub
parent
commit
71e810c89d
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
  1. 1
      framework/CHANGELOG.md
  2. 7
      framework/web/DbSession.php

1
framework/CHANGELOG.md

@ -14,6 +14,7 @@ Yii Framework 2 Change Log
- Bug #19204: Support numbers in Inflector::camel2words (longthanhtran) - Bug #19204: Support numbers in Inflector::camel2words (longthanhtran)
- Bug #19004: Container::resolveCallableDependencies() unable to handle union and intersection types (sartor) - 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 #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 2.0.44 December 30, 2021

7
framework/web/DbSession.php

@ -140,7 +140,7 @@ class DbSession extends MultiFieldSession
->queryOne(); ->queryOne();
}); });
if ($row !== false) { if ($row !== false && $this->getIsActive()) {
if ($deleteOldSession) { if ($deleteOldSession) {
$this->db->createCommand() $this->db->createCommand()
->update($this->sessionTable, ['id' => $newID], ['id' => $oldID]) ->update($this->sessionTable, ['id' => $newID], ['id' => $oldID])
@ -151,11 +151,6 @@ class DbSession extends MultiFieldSession
->insert($this->sessionTable, $row) ->insert($this->sessionTable, $row)
->execute(); ->execute();
} }
} else {
// shouldn't reach here normally
$this->db->createCommand()
->insert($this->sessionTable, $this->composeFields($newID, ''))
->execute();
} }
} }

Loading…
Cancel
Save