public function AutologoutTestSessionCleanupOnLogin::closeAllSessions in Automated Logout 7.4
Close all stashed sessions and the current session.
1 call to AutologoutTestSessionCleanupOnLogin::closeAllSessions()
- AutologoutTestSessionCleanupOnLogin::testSessionCleanupAtLogin in tests/
autologout.test - Test that stale sessions are cleaned up at login.
File
- tests/
autologout.test, line 166 - Simpletest tests for autologout.
Class
- AutologoutTestSessionCleanupOnLogin
- Test session cleanup on login.
Code
public function closeAllSessions() {
foreach ($this->curlHandles as $cookie_file => $curl_handle) {
if (isset($curl_handle)) {
curl_close($curl_handle);
}
}
// Make the server forget all sessions.
db_truncate('sessions')
->execute();
$this->curlHandles = array();
$this->loggedInUsers = array();
$this->loggedInUser = FALSE;
$this->cookieFile = $this->public_files_directory . '/' . $this
->randomName() . '.jar';
unset($this->curlHandle);
}