# Log the User out from Auth0

**URL:** <https://community.auth0.com/t/log-the-user-out-from-auth0/108294>\
**Category:** Get Help\
**Tags:** reset-password-prompt-classic-experience, login-experience\
**Created:** [June 1, 2023, 9:26am UTC](https://community.auth0.com/t/log-the-user-out-from-auth0/108294 "2023-06-01T09:26:20Z")\
**Posts on this page:** 7\
**Page:** 1

<div class="post-metadata">

**Author:** ![avinash.singh1](https://upload.wikimedia.org/wikipedia/commons/thumb/7/7c/User_font_awesome.svg/768px-User_font_awesome.svg.png) [@avinash.singh1](https://community.auth0.com/u/avinash.singh1)\
**Post date:** [June 1, 2023, 9:26am UTC](https://community.auth0.com/t/log-the-user-out-from-auth0/108294/1 "2023-06-01T09:26:20Z")

</div>

**User logout** - Session need to be clear at **Application Session Layer** and **Auth0 Session Layer.** While invalidating the session from the Auth0 side, the given API works with CLIENT\_ID which is at Application level and Can’t see any option of sending the Authentication token with request.  
How to manage with the logout of a particular user ? How Auth0 will know the user which is needed to be logout ?

---

<div class="post-metadata">

**Author:** ![dan.woda](https://sea1.discourse-cdn.com/auth0/user_avatar/community.auth0.com/dan.woda/32/18340_2.png) [@dan.woda](https://community.auth0.com/u/dan.woda)\
**Post date:** [June 13, 2023, 12:42pm UTC](https://community.auth0.com/t/log-the-user-out-from-auth0/108294/3 "2023-06-13T12:42:13Z")

</div>

Hi @avinash.singh1,

The[logout endpoint](https://auth0.com/docs/api/authentication#logout) uses a session cookie to determine the user session that should be terminated.

Hope this helps!

---

<div class="post-metadata">

**Author:** ![avinash.singh1](https://upload.wikimedia.org/wikipedia/commons/thumb/7/7c/User_font_awesome.svg/768px-User_font_awesome.svg.png) [@avinash.singh1](https://community.auth0.com/u/avinash.singh1)\
**Post date:** [June 14, 2023, 8:30am UTC](https://community.auth0.com/t/log-the-user-out-from-auth0/108294/4 "2023-06-14T08:30:05Z")

</div>

Hello Dan, Thanks for your reply!  
I can see the expired cookies in the response. May be it’s a very basic question but when we will call the [logout endpoint](https://auth0.com/docs/api/authentication#logout), how the API knows which user needs to be logout as we are not passing any user specific information in the logout API request. Is there any user reference in the response cookies ?

---

<div class="post-metadata">

**Author:** ![dan.woda](https://sea1.discourse-cdn.com/auth0/user_avatar/community.auth0.com/dan.woda/32/18340_2.png) [@dan.woda](https://community.auth0.com/u/dan.woda)\
**Post date:** [June 14, 2023, 12:22pm UTC](https://community.auth0.com/t/log-the-user-out-from-auth0/108294/5 "2023-06-14T12:22:05Z")

</div>

The API uses the cookie in the request to identify which session to terminate.

---

<div class="post-metadata">

**Author:** ![avinash.singh1](https://upload.wikimedia.org/wikipedia/commons/thumb/7/7c/User_font_awesome.svg/768px-User_font_awesome.svg.png) [@avinash.singh1](https://community.auth0.com/u/avinash.singh1)\
**Post date:** [June 14, 2023, 3:09pm UTC](https://community.auth0.com/t/log-the-user-out-from-auth0/108294/6 "2023-06-14T15:09:35Z")

</div>

In terms of Auth0 login pages (Classic/Universal) it’s fine and it may work but in case of “Machine to Machine” or “Regular Web Application”, how to handle it ? There are cookies coming from the web page/App but not sure which cookie we need to pass with the Auth0 request .

---

<div class="post-metadata">

**Author:** ![dan.woda](https://sea1.discourse-cdn.com/auth0/user_avatar/community.auth0.com/dan.woda/32/18340_2.png) [@dan.woda](https://community.auth0.com/u/dan.woda)\
**Post date:** [June 14, 2023, 4:18pm UTC](https://community.auth0.com/t/log-the-user-out-from-auth0/108294/7 "2023-06-14T16:18:13Z")

</div>

There is no user in a Machine to Machine transaction so we can ignore that flow.

A regular web app still have a session that can be invalidated. Are you using an SDK? You shouldn’t need to choose which cookies you are sending with a request. Most of our SDKs will handle logout for you.

---

<div class="post-metadata">

**Author:** ![system](https://global.discourse-cdn.com/auth0/original/3X/b/5/b560f266932fcce5d57f09a6595bd50518cae3f3.jpeg) [@system](https://community.auth0.com/u/system)\
**Post date:** [June 29, 2023, 2:53pm UTC](https://community.auth0.com/t/log-the-user-out-from-auth0/108294/8 "2023-06-29T14:53:11Z")

</div>

This topic was automatically closed 14 days after the last reply. New replies are no longer allowed.
