If you are building a static site (e.g. you
only have HTML, CSS, and JS files), there should be no concept of user state/session. Although not a static site,
edx.org does not store any user state. Instead the JS—much of the site is rendered client-side—relies on a
cookie set by LMS to determine if the user is logged in and the user's username.
The best way to approach user-specific data for static sites is to pretend you don't have a database,
because you don't! I started, but never completed, a demonstration of displaying enrollment status on static pages:
https://github.com/edx/marketing-site/tree/clintonb/enrollments. The idea there is to use the session cookie, set by LMS on the naked domain (.
edx.org), to authenticate client-side calls to the Enrollment API. At no point are any API requests being made to the non-existent marketing server.
Hope that helps.