# Unable to logout - serious security issue

**URL:** <https://devforum.okta.com/t/unable-to-logout-serious-security-issue/25311>\
**Category:** OAuth/OIDC\
**Created:** [September 14, 2023, 4:00pm UTC](https://devforum.okta.com/t/unable-to-logout-serious-security-issue/25311 "2023-09-14T16:00:59Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![johnflux](https://avatars.discourse-cdn.com/v4/letter/j/aca169/32.png) [@johnflux](https://devforum.okta.com/u/johnflux)\
**Post date:** [September 14, 2023, 4:00pm UTC](https://devforum.okta.com/t/unable-to-logout-serious-security-issue/25311/1 "2023-09-14T16:00:59Z")

</div>

In javascript, I’m calling okta logout:

await oktaAuth?.signOut({ postLogoutRedirectUri: "http:// });

and in the network tab I see two revoke requests followed by a logout request:

POST …/oauth2/default/v1/revoke  
POST …/oauth2/default/v1/revoke  
GET …/oauth2/default/v1/logout?id\_token\_hint=eyJr…

These all return 200 OK.

But when I then redirect to login:

GET /oauth2/default/v1/authorize?client\_id=0oa18sjj5xt6…&code\_challenge=0cRjeimk…&code\_challenge\_method=S256&nonce=I8Cok…&redirect\_uri=…%2Flogin%2Fcallback&response\_type=code&state=86I27i4P…&scope=openid%20profile%20email%20offline\_access

This succeeds!!

Shouldn’t this fail? It means it’s impossible to logout. Shouldn’t revoking and login out prevent this?

---

<div class="post-metadata">

**Author:** ![erik](https://avatars.discourse-cdn.com/v4/letter/e/b5ac83/32.png) [@erik](https://devforum.okta.com/u/erik)\
**Post date:** [September 15, 2023, 5:20am UTC](https://devforum.okta.com/t/unable-to-logout-serious-security-issue/25311/2 "2023-09-15T05:20:51Z")

</div>

Hello,

Yes the 3rd call should clear the Okta session cookie `idx` / `sid` depending. In the network tab in the browser dev console, for the …/logout call does the http response headers include a `set-cookie` for the sid/idx cookie to expire them?

If you do see the cookie(s) removed from the browser the next thing to verify is,

- if your Okta Org uses a custom domain URL make sure you don’t have sessions for both your custom domain URL and the Okta domain URL. If you did and you logged out of the Okta domain URL but the `/authorize` call went to the custom domain URL that session would still exist.
- if your user uses an external IdP registered in your Okta Org, logging out of Okta does not logout of the external IdP session. So an `/authorize` call might immediately redirect to the IdP where the session still exists, the user would be SSO into the application and get a new Okta session.

Thank You,

---

<div class="post-metadata">

**Author:** ![andrea](https://sea1.discourse-cdn.com/oktadev/user_avatar/devforum.okta.com/andrea/32/2172_2.png) [@andrea](https://devforum.okta.com/u/andrea)\
**Post date:** [February 16, 2024, 12:46am UTC](https://devforum.okta.com/t/unable-to-logout-serious-security-issue/25311/3 "2024-02-16T00:46:29Z")

</div>

Closed on February 16, 2024, 12:46am UTC


