Not able to logout

Disclaimer: I’m just starting out with auth0 and am not an experienced PHP developer.

I’m using the PHP example code that is shown in the application ‘Quickstart’ section for PHP as a template.

I’ve got a few authentication providers configured using auth0’s dev keys.

Login is working fine.

However, when I try to log out, it’s just not.

There’s no error, the user is redirected to the base URL (‘localhost:9999/’) and the user info is displayed again.

The logout url that is generated from the $auth0->logout(…) function is:

https://midrange.us.auth0.com/v2/logout?returnTo=http%3A%2F%2Flocalhost%3A9999&client_id=QvpoWjL2hE8qUzzzSd4VpmtlxG2MG4Nuf3t

I did change the example by adding a cookieExpires parameter (7 days).

The logout code is this:

    $logoutUrl = $auth0->logout(ROUTE_URL_INDEX);
    header("Location: " . $logoutUrl); // $auth0->logout(ROUTE_URL_INDEX));
    exit;


I’m 95% sure it’s something I’m doing … but have no idea what it is.

Any suggestions?

Thanks!

David

FWIW: The auth0 log indicates I successfully logged out.

But when my code retrieves the session from the getCredentials() method, it still gets information. I’m expecting that value to be null after logout.

Well, I got it working … I deployed my code to a live website and I’m able to log in and out.