function SessionHttpsTest::setUp

Same name in other branches
  1. 9 core/modules/system/tests/src/Functional/Session/SessionHttpsTest.php \Drupal\Tests\system\Functional\Session\SessionHttpsTest::setUp()
  2. 8.9.x core/modules/system/tests/src/Functional/Session/SessionHttpsTest.php \Drupal\Tests\system\Functional\Session\SessionHttpsTest::setUp()
  3. 10 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() : void {
    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();
    }
}

Buggy or inaccurate documentation? Please file an issue. Need support? Need help programming? Connect with the Drupal community.