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

**URL:** <https://meta.discourse.org/t/is-there-an-endpoint-to-check-if-a-user-is-logged-in/72780>\
**Category:** Development\
**Created:** [October 25, 2017, 6:26pm UTC](https://meta.discourse.org/t/is-there-an-endpoint-to-check-if-a-user-is-logged-in/72780 "2017-10-25T18:26:47Z")\
**Posts on this page:** 1\
**Showing post:** 9

<div class="post-metadata">

**Author:** ![j127](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/j127/32/79093_2.png) [@j127](https://meta.discourse.org/u/j127)\
**Post date:** [July 21, 2018, 3:16pm UTC](https://meta.discourse.org/t/is-there-an-endpoint-to-check-if-a-user-is-logged-in/72780/9 "2018-07-21T15:16:24Z")

</div>

The Discourse session cookie appears to be just for the subdomain, so would the cookie be accessible from the top-level domain? I see `_forum_session` on the Discourse subdomain but it doesn’t appear when visiting the TLD.

If the cookie were available on the top-level domain, I was thinking that it would also be passed to the backend, so the backend could forward it to Discourse, but I’m not sure.

Maybe it requires using Discourse as an SSO provider? If it isn’t known whether the user is logged in, then we could redirect through the SSO process to check. I’m currently setting it up on a test server to see if it would work.

Edit: my end goal is to generate a JWT with the user data from Discourse (only if logged in to Discourse) and pass it to Firebase. There is a Discourse server on the subdomain, an extra backend server that can perform additional logic, and an SPA that connects to Firebase if given a JWT.

---

_[View the full topic](https://meta.discourse.org/t/is-there-an-endpoint-to-check-if-a-user-is-logged-in/72780)._
