Created
October 14, 2019 12:18
-
-
Save wixaw/96626767d6eb17ea9e78911f6fe70f46 to your computer and use it in GitHub Desktop.
Cleaning remove delete SSO CAS session apereo/mod_auth_cas PHP
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
// Cleaning CAS session apereo/mod_auth_cas (https://github.com/apereo/mod_auth_cas) | |
// Sarting session | |
session_start(); | |
if ((!isset($_SERVER["PHP_AUTH_USER"])) || (!empty($_SERVER["PHP_AUTH_USER"]))) { | |
// Get username | |
$login = $_SERVER["PHP_AUTH_USER"]; | |
// Select your Folder ( set by CASCookiePath /var/cache/apache2/mod_auth_cas/ ) | |
$sessionFolder = "/var/cache/apache2/mod_auth_cas/"; | |
$exec = shell_exec("cd $sessionFolder ; grep -l $login * | xargs rm"); | |
// Cleanup | |
$_SESSION = array(); | |
// On détruit les variables de notre session | |
session_unset(); | |
// On détruit notre session | |
session_destroy(); | |
} | |
header("location:https://sso.irit.fr/cas/logout"); //Redirect vers le CAS | |
exit(); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment