# I am facing issue in logout Api

**URL:** <https://community.auth0.com/t/i-am-facing-issue-in-logout-api/94384>\
**Category:** Get Help\
**Tags:** sessions, logout\
**Created:** [November 14, 2022, 12:14pm UTC](https://community.auth0.com/t/i-am-facing-issue-in-logout-api/94384 "2022-11-14T12:14:18Z")\
**Posts on this page:** 14\
**Page:** 1

<div class="post-metadata">

**Author:** ![support25](https://sea1.discourse-cdn.com/auth0/user_avatar/community.auth0.com/support25/32/33671_2.png) [@support25](https://community.auth0.com/u/support25)\
**Post date:** [November 14, 2022, 12:14pm UTC](https://community.auth0.com/t/i-am-facing-issue-in-logout-api/94384/1 "2022-11-14T12:14:18Z")

</div>

Basically I have two environemnts Dev and production. When user logout from dev environment. User is logged out from Auth0. But when user logged out from production environment, when user try to login again Auth0 don’t ask for username and password. User is automatically logged in Auth0. Both environments have same code deployed.

---

<div class="post-metadata">

**Author:** ![ritiwari369](https://sea1.discourse-cdn.com/auth0/user_avatar/community.auth0.com/ritiwari369/32/36504_2.png) [@ritiwari369](https://community.auth0.com/u/ritiwari369)\
**Post date:** [November 14, 2022, 12:38pm UTC](https://community.auth0.com/t/i-am-facing-issue-in-logout-api/94384/2 "2022-11-14T12:38:46Z")

</div>

> [@support25](#):
>
> But when user logged out from production environment, when user try to login again Auth0 don’t ask for username and password. User is automatically logged in Auth0.

I’m also facing same issue. In production, user just gets logged in (using authorization code) after calling logout() in code.

```auto
logout({ returnTo: window.location.origin });

```

Please look into it @dan.woda

---

<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:** [November 14, 2022, 5:01pm UTC](https://community.auth0.com/t/i-am-facing-issue-in-logout-api/94384/4 "2022-11-14T17:01:26Z")

</div>

Hi @support25 @ritiwari369

Welcome to the Auth0 Community!

If you have a quest about the Auth0 product, please use the “Help” category. I’ll move this topic now.

Could you please provide more info about how you are logging out? What SDK, version, and methods you are using. Thanks.

---

<div class="post-metadata">

**Author:** ![support25](https://sea1.discourse-cdn.com/auth0/user_avatar/community.auth0.com/support25/32/33671_2.png) [@support25](https://community.auth0.com/u/support25)\
**Post date:** [November 15, 2022, 12:26pm UTC](https://community.auth0.com/t/i-am-facing-issue-in-logout-api/94384/5 "2022-11-15T12:26:36Z")

</div>

HI @dan.woda

We are using

because of CMS kentico old version we are using. Basically my question is same logout method work on Dev environment but it dont work on Production environment. Do I have to change tenant setting or something ?

---

<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:** [November 15, 2022, 8:23pm UTC](https://community.auth0.com/t/i-am-facing-issue-in-logout-api/94384/6 "2022-11-15T20:23:00Z")

</div>

@support25

Logout works of a few different levels. It could be how your app handles it.

Auth0 should be deleting the cookie session when you hit the endpoint. That should be consistent.

Have you looked through our docs?

> **[Logout](https://auth0.com/docs/authenticate/login/logout)**
>
> Describes how logout works with Auth0.

---

<div class="post-metadata">

**Author:** ![support25](https://sea1.discourse-cdn.com/auth0/user_avatar/community.auth0.com/support25/32/33671_2.png) [@support25](https://community.auth0.com/u/support25)\
**Post date:** [November 16, 2022, 2:13pm UTC](https://community.auth0.com/t/i-am-facing-issue-in-logout-api/94384/7 "2022-11-16T14:13:28Z")

</div>

@dan.woda

Yes I have seen these docs. We are using version=“7.16.1” and how its working on one environment and not working on other ?

---

<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:** [November 16, 2022, 4:28pm UTC](https://community.auth0.com/t/i-am-facing-issue-in-logout-api/94384/8 "2022-11-16T16:28:14Z")

</div>

It’s hard to say without any more information about your apps.

---

<div class="post-metadata">

**Author:** ![support25](https://sea1.discourse-cdn.com/auth0/user_avatar/community.auth0.com/support25/32/33671_2.png) [@support25](https://community.auth0.com/u/support25)\
**Post date:** [November 16, 2022, 4:40pm UTC](https://community.auth0.com/t/i-am-facing-issue-in-logout-api/94384/9 "2022-11-16T16:40:22Z")

</div>

@dan.woda  
Please do let me know what more you need to guid me ? Thank you

---

<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:** [November 16, 2022, 4:46pm UTC](https://community.auth0.com/t/i-am-facing-issue-in-logout-api/94384/10 "2022-11-16T16:46:37Z")

</div>

Can you please provide a [HAR](https://auth0.com/docs/troubleshoot/guides/generate-har-files) file of the failed logout? You can DM it to me.

---

<div class="post-metadata">

**Author:** ![support25](https://sea1.discourse-cdn.com/auth0/user_avatar/community.auth0.com/support25/32/33671_2.png) [@support25](https://community.auth0.com/u/support25)\
**Post date:** [November 17, 2022, 11:11am UTC](https://community.auth0.com/t/i-am-facing-issue-in-logout-api/94384/11 "2022-11-17T11:11:46Z")

</div>

@dan.woda please check your inbox.

---

<div class="post-metadata">

**Author:** ![support25](https://sea1.discourse-cdn.com/auth0/user_avatar/community.auth0.com/support25/32/33671_2.png) [@support25](https://community.auth0.com/u/support25)\
**Post date:** [November 22, 2022, 9:34am UTC](https://community.auth0.com/t/i-am-facing-issue-in-logout-api/94384/12 "2022-11-22T09:34:30Z")

</div>

@dan.woda Any update please?

---

<div class="post-metadata">

**Author:** ![support25](https://sea1.discourse-cdn.com/auth0/user_avatar/community.auth0.com/support25/32/33671_2.png) [@support25](https://community.auth0.com/u/support25)\
**Post date:** [November 23, 2022, 9:55am UTC](https://community.auth0.com/t/i-am-facing-issue-in-logout-api/94384/13 "2022-11-23T09:55:02Z")

</div>

@ritiwari369 any suggestions please?

---

<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:** [November 28, 2022, 3:27pm UTC](https://community.auth0.com/t/i-am-facing-issue-in-logout-api/94384/14 "2022-11-28T15:27:43Z")

</div>

Hi @support25,

Apologies for the delay, I responded in our DM.

---

<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:** [January 30, 2023, 9:35pm UTC](https://community.auth0.com/t/i-am-facing-issue-in-logout-api/94384/15 "2023-01-30T21:35:58Z")

</div>

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