You are here

protected function SessionHttpsTest::getGuzzleCookieJar in Drupal 9

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

Creates a new Guzzle CookieJar with a Xdebug cookie if necessary.

Return value

\GuzzleHttp\Cookie\CookieJar The Guzzle CookieJar.

2 calls to SessionHttpsTest::getGuzzleCookieJar()
SessionHttpsTest::loginHttp in core/modules/system/tests/src/Functional/Session/SessionHttpsTest.php
Log in a user via HTTP.
SessionHttpsTest::loginHttps in core/modules/system/tests/src/Functional/Session/SessionHttpsTest.php
Log in a user via HTTPS.

File

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

Class

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

Namespace

Drupal\Tests\system\Functional\Session

Code

protected function getGuzzleCookieJar() {

  // @todo Add xdebug cookie.
  $cookies = $this
    ->extractCookiesFromRequest(\Drupal::request());
  foreach ($cookies as $cookie_name => $values) {
    $cookies[$cookie_name] = $values[0];
  }
  return CookieJar::fromArray($cookies, $this->baseUrl);
}