Skip to content

Commit

Permalink
#68 add multi server logout() capabilities.
Browse files Browse the repository at this point in the history
  • Loading branch information
jfritschi committed Mar 17, 2013
1 parent c3cb3ab commit 550c0eb
Showing 1 changed file with 15 additions and 3 deletions.
18 changes: 15 additions & 3 deletions source/CAS/Client.php
Expand Up @@ -1640,9 +1640,21 @@ public function logout($params)
}
header('Location: '.$cas_url);
phpCAS::trace("Prepare redirect to : ".$cas_url);

session_unset();
session_destroy();
// delete the session data of this CAS server
unset($_SESSION['phpCAS'][$this->getServerBaseURL()]);
// Delete full session only if no other CAS data is in the session
if (sizeof($_SESSION['phpCAS']) === 0) {
phpCAS::trace(
" Session " . session_id() . "is empty. Deleting session."
);
session_unset();
session_destroy();
} else {
phpCAS::trace(
" Session " . session_id()
. "is not empty. Skipping session deletion."
);
}
$lang = $this->getLangObj();
$this->printHTMLHeader($lang->getLogout());
printf('<p>'.$lang->getShouldHaveBeenRedirected(). '</p>', $cas_url);
Expand Down

0 comments on commit 550c0eb

Please sign in to comment.