Identifying if Okta session already exists

I have an application which uses OKTA for authentication and everything works fine out of box.

However I have a need that when users tries to browse my site (say Application A) and if OKTA session doesn’t exists or user is not logged into OKTA, I need to take user to a different site (say Application B). User logs into B which creates a OKTA session and is redirected to A.

So in Application A I need to be able to identify if OKTA session already existed then do not redirect to B and continue with flow. How do I check for this condition.

I am using OWIN with MVC. Please let me know if you need any code samples if my ask is not clear, I can provide more details.

As long as both applications are looking at the same Okta domain, and the user is authenticated with Okta with an Okta session cookie in their browser, you can confirm that they have a session by making a CORS request to /api/v1/sessions/me.