Pengcheng,

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 
<https://github.com/edx/edx-platform/blob/6ea32b7ae6f9de74b160482a1cace2972db87c82/common/djangoapps/student/cookies.py>
 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.

Clinton

On Tuesday, February 27, 2018 at 7:46:36 PM UTC-8, pcliu wrote:
>
> Hi there,
>
> I am trying to use wagtail for building marketing site for open edX, which 
> basically follow the work did by @clinton.
>  One problem I am facing is the wagtail site and lms are using different 
> sessions, so that they may expire at different time. IS it possible to make 
> the two site s  share user db and sessions? I heard that edx.org is using 
> drupal for home page, and I am wondering how the integration is done.
>
> Thanks,
> Pengcheng
>

-- 
You received this message because you are subscribed to the Google Groups 
"General Open edX discussion" group.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/edx-code/1b210ffc-db8f-4337-ae01-f3018d2d25ab%40googlegroups.com.

Reply via email to