public function SessionTestSubscriber::onKernelResponseSessionTest

Set header for session testing.

Parameters

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

File

drupal/core/modules/system/tests/modules/session_test/lib/Drupal/session_test/EventSubscriber/SessionTestSubscriber.php, line 41
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) {
  $event
    ->getResponse()->headers
    ->set('X-Session-Empty', $this->emptySession);
}