---
title: How to force a user's logout
description: This article explains the steps you can follow to force a user logout/terminate their session using the Login V2
---

[Skip to content](https://help.zitadel.com/how-to-force-a-users-logout#main-content)

[![zitadel-logo\_text-dark (1)](https://help.zitadel.com/hs-fs/hubfs/zitadel-logo_text-dark%20(1).png?width=210&height=60&name=zitadel-logo_text-dark%20(1).png)](https://help.zitadel.com/?hsLang=en)

Open main navigation

Close main navigation

- [Documentation](https://zitadel.com/docs)

[Documentation](https://zitadel.com/docs)

 How can we help you?

- There are no suggestions because the search field is empty.

1. [ZITADEL Knowledge Base](https://help.zitadel.com/?hsLang=en)
2. [Authentication & Login](https://help.zitadel.com/authentication-login?hsLang=en)

August 27, 2025

# How to force a user's logout

## This article explains the steps you can follow to force a user logout/terminate their session using the Login V2

The Login V2 internally leverages the sessions API, creating a session when the user logs in. This session is referenced by the SSO cookie stored in the browser when the login flow completes, allowing the user to retrieve new tokens without the need to provide their credentials.

To log the user out, or terminate their sessions, there are 2 alternatives:

- The client (browser) can log the user out by calling the [end\_session\_endpoint](https://zitadel.com/docs/apis/openidoauth/endpoints#end_session_endpoint), which is an interactive endpoint, meaning that the user has to navigate to that URL, or
- The internal session can be deleted using the sessions API, which is what is article focuses on.

Using the sessions API it is possible to retrieve, and delete those sessions, this is a 2 steps process:

1\. Retrieve the sessions for that user:

`POST <instance_domain>/v2/sessions/search`

`body: application/json `

`{`

`  "queries": [`

`    {`

`      "userIdQuery": {`

`      "id": "<USER_ID>"`

`      }`

`    }`

`  ]`

`}`

 

This will return all the sessions for that user, a more sophisticated query may be used to filter the results, see the following:

- [Search sessions](https://zitadel.com/docs/apis/resources/session_service_v2/session-service-list-sessions)

2\. Delete the session by ID, using the ID from step 1

`DELETE <instance_domain>/v2/sessions/<session_id>`

After that, the user's session will be terminated.

Reference:

- [Terminate an existing session](https://zitadel.com/docs/apis/resources/session_service_v2/session-service-delete-session)
- [Login V2](https://zitadel.com/docs/guides/integrate/login/hosted-login#hosted-login-version-2-beta)

````

- [Getting Started](https://help.zitadel.com/getting-started?hsLang=en)
- [User Management](https://help.zitadel.com/user-management?hsLang=en)
- [Authentication & Login](https://help.zitadel.com/authentication-login?hsLang=en)
- [Security & Compliance](https://help.zitadel.com/security-compliance?hsLang=en)
- [Troubleshooting](https://help.zitadel.com/troubleshooting?hsLang=en)
- [Account & Subscription](https://help.zitadel.com/account-subscription?hsLang=en#main-content)

    - [Support](https://help.zitadel.com/account-subscription?hsLang=en#support)
    - [Billing (Pro)](https://help.zitadel.com/account-subscription?hsLang=en#billing-pro)
    - [Billing (Enterprise)](https://help.zitadel.com/account-subscription?hsLang=en#billing-enterprise)
    - [Zitadel Cloud Account](https://help.zitadel.com/account-subscription?hsLang=en#zitadel-cloud-account)
    - [Service Description](https://help.zitadel.com/account-subscription?hsLang=en#service-description)
- [Default Settings](https://help.zitadel.com/default-settings?hsLang=en#main-content)

    - [Web Keys](https://help.zitadel.com/default-settings?hsLang=en#web-keys)
- [Self-Hosting](https://help.zitadel.com/self-hosting?hsLang=en)

[![zitadel-logo\_text-dark](https://help.zitadel.com/hs-fs/hubfs/zitadel-logo_text-dark.png?width=210&height=60&name=zitadel-logo_text-dark.png "zitadel-logo_text-dark")](http://zitadel.com)

1 Embarcadero Center, Suite 1200  
San Francisco, CA 94111

<https://github.com/zitadel/zitadel> <https://x.com/zitadel> <https://www.facebook.com/zitadel.social> <https://www.linkedin.com/company/zitadel/> <https://zitadel.com/chat> <https://www.youtube.com/@zitadel>

Copyright © 2025 All rights reserved.