1$state = \SimpleSAML\Auth\State::loadState((string)$_REQUEST['LogoutState'], 'MyLogoutState');
2$ls = $state['saml:sp:LogoutStatus']; /* Only works for SAML SP */
3if ($ls['Code'] === 'urn:oasis:names:tc:SAML:2.0:status:Success' && !isset($ls['SubCode'])) {
4 /* Successful logout. */
5 echo("You have been logged out.");
6} else {
7 /* Logout failed. Tell the user to close the browser. */
8 echo("We were unable to log you out of all your sessions. To be completely sure that you are logged out, you need to close your web browser.");
9}
10