Commit bd3dd038 by Qiang Xue

Fixed user status check.

parent b751211d
...@@ -201,9 +201,6 @@ class Session extends Component implements \IteratorAggregate, \ArrayAccess, \Co ...@@ -201,9 +201,6 @@ class Session extends Component implements \IteratorAggregate, \ArrayAccess, \Co
*/ */
public function getHasSessionId() public function getHasSessionId()
{ {
if ($this->getIsActive()) {
return true;
}
if ($this->_hasSessionId === null) { if ($this->_hasSessionId === null) {
$name = $this->getName(); $name = $this->getName();
$request = Yii::$app->getRequest(); $request = Yii::$app->getRequest();
......
...@@ -525,7 +525,7 @@ class User extends Component ...@@ -525,7 +525,7 @@ class User extends Component
protected function renewAuthStatus() protected function renewAuthStatus()
{ {
$session = Yii::$app->getSession(); $session = Yii::$app->getSession();
$id = $session->getHasSessionId() ? $session->get($this->idParam) : null; $id = $session->getHasSessionId() || $session->getIsActive() ? $session->get($this->idParam) : null;
if ($id === null) { if ($id === null) {
$identity = null; $identity = null;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment