How to get current session info?

Hi,

We are upgrading to OIE from Okta Classic. By following the documentation here Understand how sessions work after the upgrade | Okta Developer, we learned that /api/v1/sessions/${sessionId} - GET would be deprecated in OIE and also the alternative is sessions/me. However, when I did a quick POC with calling sessions/me endpoint, it extends my session each time I’m calling it with our Prod Org. It does not extend session with our Preview Org.

Our business scenario is that we want to alert end user when its session gets close to expire

My questions are:

  • How are we supposed to get current session info?

  • What would be the alternative OKTA API to be called in OIE to get session info?

1 Like

Preview:

Prod:

Hey @Patrick.Ding, what you have discovered is a known issue Okta Help Center (Lightning). Without GET /api/v1/sessions/${sessionId} looks like there wouldn’t be another way to get current session info :frowning:. As your use case is a good example of how devs utilize this endpoint, I recommend posting on our Ideas Page to make this known to our Product Team.

1 Like

Thanks for the response. Any idea why my Preview Org behaves differently than Prod Org with exactly same endpoint? If there is no such alternative API to be called, are you saying as Okta clients we are not able to know the session timeout in any means with OIE? Just want to understand a bit more.