.
Copyright 2015 Frank Schreiterer, University of Bamberg, Computing Centre
*/
function removeMemcached($destid) {
$mcsrv="127.0.0.1";
$mcport="11211";
$mc=new Memcache;
$mc->connect($mcsrv,$mcport);
$stats = $mc->getExtendedStats();
$list = array();
#memcached auslesen und bei passendem Wert den Key entfernen
$allSlabs = $mc->getExtendedStats('slabs');
$items = $mc->getExtendedStats('items');
foreach($allSlabs as $server => $slabs) {
foreach($slabs AS $slabId => $slabMeta) {
if (is_numeric($slabId)) {
$cdump = $mc->getExtendedStats('cachedump',(int)$slabId);
foreach($cdump AS $keys => $arrVal) {
if (!is_array($arrVal)) continue;
foreach($arrVal AS $k => $v) {
$get = $mc->get($k);
if ($get == $destid) {
$ret = $mc->delete($k);
}
}
}
}
}
}
#und bei mixedLazy den Sicherungseintrag zur destid
$ret = $mc->delete($destid);
$mc->close();
}
#eine böse Anwendungs-Session-ID zerstören
if (isset($_REQUEST['appsid'])) {
$destid = $_REQUEST['appsid'];
if ($destid != "") {
session_id($destid);
removeMemcached($destid);
session_start();
session_destroy();
}
}
session_start();
$serverurl="https://".$_SERVER['SERVER_NAME'];
if (isset($_REQUEST['shibloggedoff'])) {
$shiblogoff = $_REQUEST['shibloggedoff'];
if ($shiblogoff == "true") {
echo "Sie wurden abgemeldet.
Erneut anmelden
";
}
} else {
$destid = session_id();
removeMemcached($destid);
$url="$serverurl/Shibboleth.sso/Logout?return=$serverurl/PATH/TO/remsess.php?shibloggedoff=true";
header('Location: '.$url);
}
session_destroy();
#SessionCookie löschen
setcookie(session_name(),"",time() -3600,"/");
?>