You are here

protected function SessionHttpsTest::setUp in Drupal 8

Same name and namespace in other branches
  1. 9 core/modules/system/tests/src/Functional/Session/SessionHttpsTest.php \Drupal\Tests\system\Functional\Session\SessionHttpsTest::setUp()

Overrides BrowserTestBase::setUp

File

core/modules/system/tests/src/Functional/Session/SessionHttpsTest.php, line 49

Class

SessionHttpsTest
Ensure that when running under HTTPS two session cookies are generated.

Namespace

Drupal\Tests\system\Functional\Session

Code

protected function setUp() {
  parent::setUp();
  $request = Request::createFromGlobals();
  if ($request
    ->isSecure()) {
    $this->secureSessionName = $this
      ->getSessionName();
    $this->insecureSessionName = substr($this
      ->getSessionName(), 1);
  }
  else {
    $this->secureSessionName = 'S' . $this
      ->getSessionName();
    $this->insecureSessionName = $this
      ->getSessionName();
  }
}