diff --git a/core/includes/install.core.inc b/core/includes/install.core.inc index 6acf24f..9774735 100644 --- a/core/includes/install.core.inc +++ b/core/includes/install.core.inc @@ -1553,11 +1553,8 @@ function install_load_profile(&$install_state) { /** * Performs a full bootstrap of Drupal during installation. - * - * @param $install_state - * An array of information about the current installation state. */ -function install_bootstrap_full(&$install_state) { +function install_bootstrap_full() { $session = \Drupal::service('session'); \Drupal::request()->setSession($session); $session->start(); diff --git a/core/lib/Drupal/Core/Authentication/Provider/Cookie.php b/core/lib/Drupal/Core/Authentication/Provider/Cookie.php index eaf457a..913cc57 100644 --- a/core/lib/Drupal/Core/Authentication/Provider/Cookie.php +++ b/core/lib/Drupal/Core/Authentication/Provider/Cookie.php @@ -100,14 +100,7 @@ protected function getUserFromSession(SessionInterface $session) { $values['roles'] = array_merge([AccountInterface::AUTHENTICATED_ROLE], $rids); return new UserSession($values); } - elseif ($values) { - // The user is anonymous or blocked. Only preserve access field from the - // {users} table. - return new UserSession([ - 'access' => $values['access'], - ]); - } - // The session has expired. + // The session has expired or user is blocked or anonymous. return new AnonymousUserSession(); } diff --git a/core/lib/Drupal/Core/Session/SessionHandler.php b/core/lib/Drupal/Core/Session/SessionHandler.php index 999d4c4..0d6f48a 100644 --- a/core/lib/Drupal/Core/Session/SessionHandler.php +++ b/core/lib/Drupal/Core/Session/SessionHandler.php @@ -62,19 +62,13 @@ public function read($sid) { if (empty($sid)) { return ''; } - - // Read the session data from the database. - $record = $this->connection->select('sessions', 's') - ->fields('s') - ->condition('sid', Crypt::hashBase64($sid)) - ->execute() - ->fetchAssoc(); - - if (isset($record['session'])) { - return $record['session']; - } else { - return ''; + // Read the session data from the database. + $query = $this->connection->select('sessions', 's') + ->fields('s', ['session']) + ->condition('sid', Crypt::hashBase64($sid)) + ->execute(); + return (string) $query->fetchField(); } } @@ -85,9 +79,10 @@ public function write($sid, $value) { // The exception handler is not active at this point, so we need to do it // manually. try { + $request = $this->requestStack->getCurrentRequest(); $fields = array( - 'uid' => $this->requestStack->getCurrentRequest()->getSession()->get('uid', 0), - 'hostname' => $this->requestStack->getCurrentRequest()->getClientIP(), + 'uid' => $request->getSession()->get('uid', 0), + 'hostname' => $request->getClientIP(), 'session' => $value, 'timestamp' => REQUEST_TIME, );