-
-
Save vincent1890/587f2d9913331b89c1cae540292cd2e8 to your computer and use it in GitHub Desktop.
Cleaning remove delete SSO CAS session apereo/mod_auth_cas PHP
This file contains 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