function SessionTest::sessionReset

Same name and namespace in other branches
  1. 11.x core/modules/system/tests/src/Functional/Session/SessionTest.php \Drupal\Tests\system\Functional\Session\SessionTest::sessionReset()
  2. 10 core/modules/system/tests/src/Functional/Session/SessionTest.php \Drupal\Tests\system\Functional\Session\SessionTest::sessionReset()
  3. 8.9.x core/modules/system/tests/src/Functional/Session/SessionTest.php \Drupal\Tests\system\Functional\Session\SessionTest::sessionReset()

Reset the cookie file so that it refers to the specified user.

File

core/modules/system/tests/src/Functional/Session/SessionTest.php, line 364

Class

SessionTest
Drupal session handling tests.

Namespace

Drupal\Tests\system\Functional\Session

Code

public function sessionReset() {
  // Close the internal browser.
  $this->mink
    ->resetSessions();
  $this->loggedInUser = FALSE;
  // Change cookie file for user.
  $this->drupalGet('session-test/get');
  $this->assertSession()
    ->statusCodeEquals(200);
}

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