You are here

public function AutologoutTestSessionCleanupOnLogin::restoreSession in Automated Logout 7.4

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.

1 call to AutologoutTestSessionCleanupOnLogin::restoreSession()
AutologoutTestSessionCleanupOnLogin::testSessionCleanupAtLogin in tests/autologout.test
Test that stale sessions are cleaned up at login.

File

tests/autologout.test, line 148
Simpletest tests for autologout.

Class

AutologoutTestSessionCleanupOnLogin
Test session cleanup on login.

Code

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;
}