# Sign out and end the session

> Signing out at /logout — confirming an application's sign-out request, the user's own sign-out, and what each ending shows.

An application ends a session through RP-initiated logout at `/end_session`. With an
`id_token_hint` that verifies and names the signed-in user, the session ends at once and
no screen shows; with nobody signed in, the browser goes straight on to the
`post_logout_redirect_uri`. Otherwise (no hint, one that does not verify, or one for
another user) the request lands on `/logout` to ask the user. See
[Sessions, Consent & Logout](https://www.nauthera.io/docs/v1/sessions#logout).

```mermaid
flowchart LR
  A([Application]) --> L["/logout"]
  L -->|Sign out| D[You're signed out]
  L -->|Cancel| K[You're still signed in]
  D -->|post_logout_redirect_uri| A2([Back to the application])
```

<StoryScreenshot id="screens-sign-out--confirm" alt="Sign out? with Sign out and Cancel" />
<StoryScreenshot id="screens-sign-out--submitting" alt="Signing out: the button spins and Cancel is withdrawn" />

- **Sign out** ends the session. With a registered `post_logout_redirect_uri` the browser
  goes back to the application; otherwise the page confirms it, with **Continue** to the
  application's sign-in or, without one, the way back to the application.
- **Cancel** keeps the session and says so.
- A sign-out the server could not complete says the user may still be signed in, and
  offers it again.

Opened without an application's request, `/logout` is the user's own sign-out: **Sign out**
ends the session, and **Cancel** is a link back to sign-in.

<StoryScreenshot id="screens-sign-out--done" alt="You're signed out, with the way back to the app" />
<StoryScreenshot id="screens-sign-out--kept" alt="You're still signed in" />
<StoryScreenshot id="screens-sign-out--failed" alt="You may still be signed in, above the question asked again" />
