Loading core/lib/Drupal/Core/Session/SessionManager.php +4 −0 Original line number Diff line number Diff line Loading @@ -257,6 +257,10 @@ public function delete($uid) { * {@inheritdoc} */ public function destroy() { if ($this->isCli()) { return; } session_destroy(); // Unset the session cookies. Loading core/tests/Drupal/KernelTests/Core/Session/SessionManagerDestroyNoCliCheckTest.php 0 → 100644 +22 −0 Original line number Diff line number Diff line <?php namespace Drupal\KernelTests\Core\Session; use Drupal\KernelTests\KernelTestBase; /** * Tests starting and destroying a session from the CLI. * * @group Session */ class SessionManagerDestroyNoCliCheckTest extends KernelTestBase { /** * Tests starting and destroying a session from the CLI. */ public function testCallSessionManagerStartAndDestroy() { $this->assertFalse(\Drupal::service('session_manager')->start()); $this->assertNull(\Drupal::service('session_manager')->destroy()); } } Loading
core/lib/Drupal/Core/Session/SessionManager.php +4 −0 Original line number Diff line number Diff line Loading @@ -257,6 +257,10 @@ public function delete($uid) { * {@inheritdoc} */ public function destroy() { if ($this->isCli()) { return; } session_destroy(); // Unset the session cookies. Loading
core/tests/Drupal/KernelTests/Core/Session/SessionManagerDestroyNoCliCheckTest.php 0 → 100644 +22 −0 Original line number Diff line number Diff line <?php namespace Drupal\KernelTests\Core\Session; use Drupal\KernelTests\KernelTestBase; /** * Tests starting and destroying a session from the CLI. * * @group Session */ class SessionManagerDestroyNoCliCheckTest extends KernelTestBase { /** * Tests starting and destroying a session from the CLI. */ public function testCallSessionManagerStartAndDestroy() { $this->assertFalse(\Drupal::service('session_manager')->start()); $this->assertNull(\Drupal::service('session_manager')->destroy()); } }