diff --git a/core/lib/Drupal/Core/Session/SessionManager.php b/core/lib/Drupal/Core/Session/SessionManager.php index 3257e39..1d470e2 100644 --- a/core/lib/Drupal/Core/Session/SessionManager.php +++ b/core/lib/Drupal/Core/Session/SessionManager.php @@ -180,14 +180,12 @@ protected function startNow() { * {@inheritdoc} */ public function save() { - $user = \Drupal::currentUser(); - if ($this->isCli()) { // We don't have anything to do if we are not allowed to save the session. return; } - if ($user->isAnonymous() && $this->isSessionObsolete()) { + if ($this->isSessionObsolete()) { // There is no session data to store, destroy the session if it was // previously started. if ($this->getSaveHandler()->isActive()) { diff --git a/core/modules/user/src/Authentication/Provider/Cookie.php b/core/modules/user/src/Authentication/Provider/Cookie.php index 35f1f8a..59bfd55 100644 --- a/core/modules/user/src/Authentication/Provider/Cookie.php +++ b/core/modules/user/src/Authentication/Provider/Cookie.php @@ -84,7 +84,7 @@ protected function getUserFromSession(SessionInterface $session) { // @todo Load User entity in handler https://www.drupal.org/node/2345611 $values = $this->connection - ->query('SELECT * FROM {users_field_data} WHERE uid = :uid AND default_langcode = 1', [':uid', $session->get('uid')]) + ->query('SELECT * FROM {users_field_data} u WHERE u.uid = :uid AND u.default_langcode = 1', [':uid' => $uid]) ->fetchAssoc(); if ($values && $values['uid'] > 0 && $values['status'] == 1) {