
AlyssaR.88389 (Customer) asked a question.
I'm setting up Okta authentication using signIn('okta') from the next-auth package that they recommend alongside Next.js. When we signOut(), the browser session is set to null, but if we redirect to the Okta-hosted sign in page, the session appears to still exist. Any suggestions on how to clear the session and log out of Okta completely? AND/OR where can we pull the Okta session cookie from to call DELETE on /api/v1/sessions/${session_cookie}, as the cookie is set to HTTP only so packages like js-cookie don't find it.

Hello @AlyssaR.88389 (Customer) Thank you for reaching out to our community.
Can you try DELETE /api/v1/sessions/${sessionId} or DELETE/api/v1/sessions/me to close the session?
Please also see our documentation here:
https://developer.okta.com/docs/reference/api/sessions/#close-current-session
Having trouble finding where to pull sessionId from to delete it, as the session cookie is HTTP only. Is there somewhere specific I can find the ID to pass to delete?
Hi, I literally searched and tried various methods for days... This finally worked for me:
signOut().then(() => {
return (window.location.href =
"https://{your-okta-org-url}/login/signout");
});