> ## Documentation Index
> Fetch the complete documentation index at: https://stytch.com/docs/llms.txt
> Use this file to discover all available pages before exploring further.

# Revoke sessions

> Revoking a session immediately invalidates the session token, effectively logging the user out. Session JWTs are not immediately revoked; they will still validate locally until they hit the 5-minute expiration mark.

<Tabs>
  <Tab title="Via SDK">
    ## Using the Stytch SDK

    <Steps>
      <Step title="Using sessions.revoke()">
        The `sessions.revoke()` [method](/api-reference/consumer/frontend-sdks/react/methods/sessions/revoke-session) clears the user and session objects from local storage unless the SDK cannot contact the Stytch servers.
      </Step>

      <Step title="Example" icon="code">
        ```javascript lines theme={null}
        export const logout = () => {
            stytch.session.revoke();
        };
        ```
      </Step>
    </Steps>
  </Tab>

  <Tab title="Via API">
    ## Using the Stytch API

    <Steps>
      <Step title="Using sessions.revoke()">
        The `sessions.revoke()` [endpoint](/api-reference/consumer/api/sessions/revoke-session) allows you to revoke a **single** user Session by providing the `session_id`, `session_token`, or `session_jwt`.
      </Step>

      <Step title="Example" icon="code">
        ```python lines theme={null}
        # POST /v1/sessions/revoke
        from stytch import Client

        client = Client(
          project_id="${projectId}",
          secret="${secret}",
        )

        resp = client.sessions.revoke(
          session_token="${sessionToken}",
        )

        print(resp)
        ```
      </Step>
    </Steps>
  </Tab>
</Tabs>

<Tip>
  We recommend showing users a list of all their active sessions so they can revoke any unrecognized session by IP address or user agent.

  Use [custom claims](/consumer-auth/manage-sessions/custom-claims#add-custom-claims-to-a-session) to attach values to the [User Session object](/api-reference/consumer/api/sessions/session-object#schema-custom-claims) via the `session_custom_claims` parameter.
</Tip>
