function NoSessionOpen::check

Same name in other branches
  1. 9 core/lib/Drupal/Core/PageCache/RequestPolicy/NoSessionOpen.php \Drupal\Core\PageCache\RequestPolicy\NoSessionOpen::check()
  2. 8.9.x core/lib/Drupal/Core/PageCache/RequestPolicy/NoSessionOpen.php \Drupal\Core\PageCache\RequestPolicy\NoSessionOpen::check()
  3. 10 core/lib/Drupal/Core/PageCache/RequestPolicy/NoSessionOpen.php \Drupal\Core\PageCache\RequestPolicy\NoSessionOpen::check()

Overrides RequestPolicyInterface::check

File

core/lib/Drupal/Core/PageCache/RequestPolicy/NoSessionOpen.php, line 39

Class

NoSessionOpen
A policy allowing delivery of cached pages when there is no session open.

Namespace

Drupal\Core\PageCache\RequestPolicy

Code

public function check(Request $request) {
    if (!$this->sessionConfiguration
        ->hasSession($request)) {
        return static::ALLOW;
    }
}

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