php - Implement single logout in simplesamlphp -
this in continuation previous question
central login saml , making site work identity provider
now have sessions @ cauth.com , a.com (or b.com).what can best way logout sessions on both site on click of "logout" button.?
this code have witten logout in cauth.com
public function actionslo(){ $metadata = \simplesaml_metadata_metadatastoragehandler::getmetadatahandler(); $idpentityid = $metadata->getmetadatacurrententityid('saml20-idp-hosted'); $idp = \simplesaml_idp::getbyid('saml2:' . $idpentityid); \sspmod_saml_idp_saml2::receivelogoutmessage($idp); assert('false'); //destroy session session_destroy(); //redirect spentity $spid = $_get['spentityid']; header("location:".$spid); }
it seems me logout take 3 http redirects
1 . when user click on "logout" requested page cauth.com/slo.
then user taken logout of main site (a.com or b.com).
user redirected index page of main site.
i want know there way can handle saml logout internally reducing number of http redirects keeping in mind have clear out session variables on both sites ?
try clear user session in
cauth.com( (cauth.com/logout))
clear user session need start user session before , destroy current user session by
session_start(); session_unset(); session_destroy();
Comments
Post a Comment