Skip to main content
Drupal API
User account menu
  • Log in

Breadcrumb

  1. Drupal Core 11.1.x
  2. SessionManager.php

function SessionManager::delete

Overrides SessionManagerInterface::delete

File

core/lib/Drupal/Core/Session/SessionManager.php, line 197

Class

SessionManager
Manages user sessions.

Namespace

Drupal\Core\Session

Code

public function delete($uid) {
    // Nothing to do if we are not allowed to change the session.
    if (!$this->writeSafeHandler
        ->isSessionWritable() || $this->isCli()) {
        return;
    }
    // The sessions table may not have been created yet.
    try {
        $this->connection
            ->delete('sessions')
            ->condition('uid', $uid)
            ->execute();
    } catch (\Exception) {
    }
}

API Navigation

  • Drupal Core 11.1.x
  • Topics
  • Classes
  • Functions
  • Constants
  • Globals
  • Files
  • Namespaces
  • Deprecated
  • Services
RSS feed
Powered by Drupal