Login issues(Redirection Loop) after setting up Studio on sub domain

I want to have my LMS and CMS in following domains:
mydomain.org
studio.mydomain.org

For this, first I tried editing the /edx/app/nginx/sites-available/cms file and changed the following:

From
listen 18010;

To
listen 80;

And then restarted nginx with:

sudo service nginx restart

After this, I can access the CMS at studio.mydomain.org but I am not able to login to CMS anymore.
So I made a fresh Juniper installation with the following settings in my config.yml.

EDXAPP_LMS_BASE: “mydomain.org
EDXAPP_CMS_BASE: “studio.mydomain.org
EDXAPP_LMS_NGINX_PORT: 80
EDXAPP_CMS_NGINX_PORT: 80

After installation I am able to view CMS at studio.mydomain.org but I am facing the same login issue as before. Here are the details of what happens when I try to login to CMS.

  1. Clicking on Sign In or Sign Up just reloads the same page.

  2. I clicked on the View About Page in studio link from LMS demo course:

I am getting these pages which looks like infinite redirect loop.

What are the files and values I need to edit to fix this issue? Thank you.

That occurs because when you log in from the LMS, it sets a cookie. then redirects you to CMS. but CMS doesn’t have access to that cookie and can’t understand the true state of your login. So redirects you back to LMS. this time LMS knows who you are so immediately redirects you to CMS and so on…

Simply set this on lms.env.json and cms.env.json files:

SESSION_COOKIE_DOMAIN: ".mydomain.org"

Note: The dot at the beginning of .mydomain.org is mandatory

EDIT: As @Sandesh_Yadav mentioned below, since the Juniper release, changes have to be applied into /edx/etc/lms.yml and /edx/etc/studio.yml instead of deprecated JSON files to be considered.

2 Likes

Thank you so much @mahyard. The issue is resolved now. There is a small change though. I edited the SESSION_COOKIE_DOMAIN value in /edx/etc/lms.yml and /edx/etc/studio.yml. That’s because in Juniper, changes in lms.env.json and cms.env.json are not reflecting. Thanks again :slight_smile:

2 Likes