Skip to content

Commit

Permalink
Merge pull request #17 from OpenConext/feature/BACKLOG-1349
Browse files Browse the repository at this point in the history
Feature/backlog 1349
  • Loading branch information
Boy Baukema committed Apr 1, 2014
2 parents 463af16 + 2df3108 commit 25e5628
Showing 1 changed file with 14 additions and 2 deletions.
16 changes: 14 additions & 2 deletions application/modules/Logout/Controller/Index.php
Original file line number Diff line number Diff line change
Expand Up @@ -36,8 +36,20 @@ public function indexAction()
*/
private function destroySession()
{
$params = session_get_cookie_params();
setcookie(session_name(), '', 0, $params['path'], $params['domain'], $params['secure'], isset($params['httponly']));
if (empty($_SESSION)) {
return;
}

// If it's desired to kill the session, also delete the session cookie.
// Note: This will destroy the session, and not just the session data!
if (ini_get("session.use_cookies")) {
$params = session_get_cookie_params();
setcookie(session_name(), '', time() - 42000,
$params["path"], $params["domain"],
$params["secure"], $params["httponly"]
);
}

session_destroy();
}
}

0 comments on commit 25e5628

Please sign in to comment.