function SessionManager::isSessionObsolete

Same name in other branches
  1. 9 core/lib/Drupal/Core/Session/SessionManager.php \Drupal\Core\Session\SessionManager::isSessionObsolete()
  2. 10 core/lib/Drupal/Core/Session/SessionManager.php \Drupal\Core\Session\SessionManager::isSessionObsolete()
  3. 11.x core/lib/Drupal/Core/Session/SessionManager.php \Drupal\Core\Session\SessionManager::isSessionObsolete()

Determines whether the session contains user data.

Return value

bool TRUE when the session does not contain any values and therefore can be destroyed.

1 call to SessionManager::isSessionObsolete()
SessionManager::save in core/lib/Drupal/Core/Session/SessionManager.php

File

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

Class

SessionManager
Manages user sessions.

Namespace

Drupal\Core\Session

Code

protected function isSessionObsolete() {
    $used_session_keys = array_filter($this->getSessionDataMask());
    return empty($used_session_keys);
}

Buggy or inaccurate documentation? Please file an issue. Need support? Need help programming? Connect with the Drupal community.