Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Destroy Session on the logout #1714

Open
Waleedviews opened this issue Nov 2, 2022 · 3 comments
Open

Destroy Session on the logout #1714

Waleedviews opened this issue Nov 2, 2022 · 3 comments

Comments

@Waleedviews
Copy link

Waleedviews commented Nov 2, 2022

Hi Guys,

I have installed the library and so far everything working very perfect. I have a question regarding the session destroy, is there any way to destroy all the active sessions of the application?

getLogoutURL() logout me from the idp provider however when i re try to access my custom application it still shows that my sessions are active.

My code:

require_once('lib/_autoload.php');
$as = new SimpleSAML_Auth_Simple('default-sp');
 if($as->isAuthenticated()){
	$attributes = $as->getAttributes();
	$email = $attributes['useremailaddress'][0];
	$authemail = $email;
	$idpaccess = "idpaccessauth";
	$session = SimpleSAML_Session::getSessionFromRequest();
	$session->cleanup();
	$_SESSION['emailemp'] = $authemail;
	$_SESSION['idpaccess'] = $idpaccess;
	redirect("".SITE. "data.php");
}else{
  echo "Not authenticated";
  $as->requireAuth();
}

thank you

@Waleedviews

This comment was marked as resolved.

@Waleedviews

This comment was marked as resolved.

@tvdijen
Copy link
Member

tvdijen commented Feb 28, 2023

Maybe your IdP doesn't support single logout..
Can you verify that your IDP sends a LogoutResponse back to you?

The alternative is that you destroy the session in your application before redirecting to the logoutURL

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants