Possible to use API to tell is someone is logged into MODX when it's a mutli-domain setup?

I have a multilingual, multidomain site, and want to enable certain things on the front end depending on whether a manager is logged into MODX. But, checking the group of the logged in user only seems to work for the domain that was used to log in. Is there any way to tell if a user is logged in, regardless of which domain is doing the checking? So, I want a snippet on domaintwo.com to be able to tell if an admin person is logged in, even when they logged in through domainone.com. Then I want domaintwo.com to display something if the view is an admin person logged into domainone.com (which is the same physical MODX installation).

When you have two different domains, I’m quite sure you get two different Session-Cookies. One per domain.

So I don’t think there is a reliable way to tell, if a request with 1 session cookie, is from the same user as a previous request with a different cookie.

The thing is, it doesn’t even work for the two contexts that share the same domain name. I have an English context and a Spanish context, and the URLs are “mydomain.com/en/. . .” and “mydomain.com/es/. . .”. Logging into “mydomain.com/manager” makes so the API can detect a manager login for the Spanish context but not the English context. Why would that be?

What do you mean by “the API” here? You need to be more specific.

if ($modx->user->isMember('Editors') || $modx->user->isMember('Administrator') ) {
 . . .

Are you making sure the users are logging in to both contexts? That is the only way it would work in both contexts. But again, this will only work where the session cookie is shared (i.e. within one domain or subdomains if your session cookies are properly configured for use across subdomains).

How do you do that ?

You would use .domain.tld — note the opening dot. See the description at: