public function SessionTestSubscriber::onKernelRequestSessionTest in Zircon Profile 8
Same name and namespace in other branches
- 8.0 core/modules/system/tests/modules/session_test/src/EventSubscriber/SessionTestSubscriber.php \Drupal\session_test\EventSubscriber\SessionTestSubscriber::onKernelRequestSessionTest()
Set header for session testing.
Parameters
\Symfony\Component\HttpKernel\Event\GetResponseEvent $event: The Event to process.
File
- core/
modules/ system/ tests/ modules/ session_test/ src/ EventSubscriber/ SessionTestSubscriber.php, line 33 - Contains \Drupal\session_test\EventSubscriber\SessionTestSubscriber.
Class
- SessionTestSubscriber
- Defines a test session subscriber that checks whether the session is empty.
Namespace
Drupal\session_test\EventSubscriberCode
public function onKernelRequestSessionTest(GetResponseEvent $event) {
$session = $event
->getRequest()
->getSession();
$this->emptySession = (int) (!($session && $session
->start()));
}