You are here

public function SessionTestSubscriber::onKernelResponseSessionTest in Zircon Profile 8

Same name and namespace in other branches
  1. 8.0 core/modules/system/tests/modules/session_test/src/EventSubscriber/SessionTestSubscriber.php \Drupal\session_test\EventSubscriber\SessionTestSubscriber::onKernelResponseSessionTest()

Performs tasks for session_test module on kernel.response.

Parameters

\Symfony\Component\HttpKernel\Event\FilterResponseEvent $event: The Event to process.

File

core/modules/system/tests/modules/session_test/src/EventSubscriber/SessionTestSubscriber.php, line 44
Contains \Drupal\session_test\EventSubscriber\SessionTestSubscriber.

Class

SessionTestSubscriber
Defines a test session subscriber that checks whether the session is empty.

Namespace

Drupal\session_test\EventSubscriber

Code

public function onKernelResponseSessionTest(FilterResponseEvent $event) {

  // Set header for session testing.
  $response = $event
    ->getResponse();
  $response->headers
    ->set('X-Session-Empty', $this->emptySession);
}