/** * {@inheritdoc} */ public function delete($uid) { // Nothing to do if we are not allowed to change the session. if (!$this->writeSafeHandler->isSessionWritable() || $this->isCli()) { return; } $this->connection->delete('sessions')->condition('uid', $uid)->execute(); }
/** * {@inheritdoc} */ public function switchBack() { // Restore the previous account from the stack. if (!empty($this->accountStack)) { $this->currentUser->setAccount(array_pop($this->accountStack)); } else { throw new \RuntimeException('No more accounts to revert to.'); } // Restore original session saving status if all account switches are // reverted. if (empty($this->accountStack)) { if ($this->originalSessionSaving) { $this->writeSafeHandler->setSessionWritable(TRUE); } } return $this; }