How to check if Okta session is still active by checking the browser? Skip to main content
https://support.okta.com/help/answers?id=9060z00000078euqay&refurl=http%3a%2f%2fsupport.okta.com%2fhelp%2fanswers
How satisfied are you with the Okta Help Center?
Thank you for your feedback!
How satisfied are you with the Okta Help Center?
1
2
3
4
5
Very Dissatisfied
Very satisfied
Enter content less than 200 characters.
Ask Search:
John HinesJohn Hines 

How to check if Okta session is still active by checking the browser?

Is there an Okta Auth JS function that doesn’t call back to Okta to check if the user session is still active? I was hoping to cut down on the amount of calls to the /sessions endpoint if there is a work-around.
 
Nate QuesadaNate Quesada (Okta, Inc.)
Hi John,

Happy to answer. All SDKs from Okta, JavaScript, or server side are wrappers around API. Only Okta way to check existing session is to make API request GET /api/v1/sessions/me which is what the auth SDK does. 

Hopefully that answers your question, let me know if I can help with anything else.

Best,
Nate
John HinesJohn Hines
So there isn't an offline (browser only) way to check if the Okta session cookie is still in the browser? I would think there would be a getCookie('cookieName').exist() way of checking for the cookie.
Nate QuesadaNate Quesada (Okta, Inc.)
Hi John,

I double checked with our Developer Support team and the answer is no-there isn't, unfortunately.

Best,
Nate