public function SessionLimitBaseTestCase::restoreSession in Session Limit 8
Same name in this branch
- 8 tests/session_limit.test \SessionLimitBaseTestCase::restoreSession()
- 8 tests/SessionLimitBaseTestCase.php \Drupal\session_limit\SessionLimitBaseTestCase::restoreSession()
Same name and namespace in other branches
- 2.x tests/SessionLimitBaseTestCase.php \Drupal\session_limit\SessionLimitBaseTestCase::restoreSession()
Restore a previously stashed session.
Parameters
string $session_id: The session to restore as returned by stashSession(); This is also the path to the cookie file.
Return value
string The old session id that was replaced.
3 calls to SessionLimitBaseTestCase::restoreSession()
- SessionLimitBaseTestCase::assertSessionLogout in tests/
SessionLimitBaseTestCase.php - Test that an individual user can have up to a specifed number of sessions.
- SessionLimitBaseTestCase::assertSessionPrevent in tests/
SessionLimitBaseTestCase.php - Test that new sessions cannot be created past a maximum.
- SessionLimitSessionTestCase::testSessionStashAndRestore in tests/
SessionLimitSessionTestCase.php - Test session stash and restore.
File
- tests/
SessionLimitBaseTestCase.php, line 225
Class
- SessionLimitBaseTestCase
- Base test for session limits.
Namespace
Drupal\session_limitCode
public function restoreSession($session_id) {
$old_session_id = NULL;
if (isset($this->curlHandle)) {
$old_session_id = $this
->stashSession();
}
// Restore the specified session.
$this->curlHandle = $this->curlHandles[$session_id];
$this->cookieFile = $session_id;
$this->loggedInUser = $this->loggedInUsers[$session_id];
return $old_session_id;
}