Developing projects outside MODX root causes "401 not authorized" on connector call

Actually this question is related to a great hint from @markh in another thread. However, I thought for the sake of better visibility, I open a new thread for this!

I’m just changing my local development environment (MAMP based, MacOS) to enable dual development for MODX 2 and 3. The setup looks like this:

/modx3/  (<- the MODX 3 root)
/modx2/  (<- the MODX 2 root)
   config.core.php  (<- the config.core.php from MODX)
/projects/  (<- dev projects folder outside MODX root)
   goodnews/ (<- project folder)

I bootstrapped my dev project with the modx2 core and the bootstrap process went well. All elements, menus, resources, settings, and so on are created within the MODX 2 installation without problems.

But when I start the Add-on I get to the index panel (which loads correctly!) but immediately a login box is displayed.
The browser console log shows a lot of these messages:

Failed to load resource: the server responded with a status of 401 (Not Authorized) --

There are no errors in PHP log and no messages in MODX error log!

I found a few other threads which could be related to this problem but none of the hints from there worked.

In my previous dev setup, the projects folder was inside the MODX root directory and it worked without any problems.

Do you have any hints on how to solve this?

maybe jakos setup could help
Streamline Developing Extras for Revo 2 & 3 with GPM | MODX

The trick should be adding the session_name as mentioned in my blog post.

And the session_cookie_path so the cookie isn’t limited to /modx2/ but applies to /

@bruno17 @jako @markh you are the best! It works perfectly now!

To summarize:

MODX 2 install:

session_name = EXTRAS2x
session_cookie_path = /

MODX 3 install:

session_name = EXTRAS3x
session_cookie_path = /

This topic was automatically closed 2 days after discussion ended and a solution was marked. New replies are no longer allowed. You can open a new topic by clicking the link icon below the original post or solution and selecting “+ New Topic”.