> For the complete documentation index, see [llms.txt](https://svgtas-organization.gitbook.io/php-oidc-client/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://svgtas-organization.gitbook.io/php-oidc-client/deal-with-the-provider/logout.md).

# Logout

Based on OpenID Connect Session Management 1.0 - [draft 17](https://openid.net/specs/openid-connect-session-1_0-17.html).

The OP must have the endpoint *end\_session\_endpoint*. It's recommended to give the *id\_token* in the request. If not set, the library tries to find it in its session.

The *redirect\_uri* can be used by the OP to redirect the user to the page defined. The *redirect\_uri* has to be registred in the OP configuration.

Basic :

```php
$client = new Svgta\OidcClient\init(
  'https://id.provider.com/.well-known/openid-configuration'
);

$id_token = 'The_Id_Token_You_Get'; //format jwt string
$redirect_uri = 'https://yourApp.tld/logoutCallback';

$client->logout($id_token, $redirect_uri);
// $id_token and $redirecti_uri are optionals. If id_token is not given, the library try to find it in the session.
// if you don't give id_token but give redirect_uri : $client->logout(null, $redirect_uri);
```


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## Querying This Documentation
If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://svgtas-organization.gitbook.io/php-oidc-client/deal-with-the-provider/logout.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
