Is there an endpoint to check if a user is logged in

How can an external server route check if the user’s browser is still logged in to Discourse? I don’t think another domain can even access Discourse’s cookies set after login.

My goal is to logout the user from the external (not Discourse) server if the user logged out of Discourse using the current active browser only. (Is it even possible?)

Thanks for the reply.