ExpressionEngine CMS
Open, Free, Amazing

Thread

This is an archived forum and the content is probably no longer relevant, but is provided here for posterity.

The active forums are here.

MSM Multiple Domain Login with Control Panel Masking (Scenarios & How It's Supposed to Work)

May 23, 2011 2:13pm

Subscribe [4]
  • #1 / May 23, 2011 2:13pm

    Shawn Dai

    76 posts

    I’m running Multiple Site Manager with 2 domains—site-1.com and site-2.com—both using control panel masks. I’ve been trying to get multiple domain logins to work.

    So, for illustration purposes, I am working with 5 (simplified) URLs that allow login / logout:

    1. site-1.com/system/
    2. site-1.com/cp-mask/
    3. site-1.com
    4. site-2.com/cp-mask/
    5. site-2.com

    (Note: Item 1 is the default site’s control panel. Items 2 and 4 are control panel masks. Items 3 and 5 are front-end.)

    I’ve tried just about every scenario of logging in and logging out with different combinations of the 5 URLs, and the results were so varied I had to create a spreadsheet to keep track of what was happening. I’ve combed the forums, wiki articles and documentation applying all the settings and trying all the suggestions, but there doesn’t seem to a definitive guide on what’s supposed to happen when multiple domain login is working correctly (and I don’t think it’s working correctly). The way I think it’s supposed to work is—say for example as a superadmin—I can login and logout from any one of the 5 URLs, and the other 4 URLs would reflect that action. Is my understanding correct?

    After some tweaking, I finally got some consistent, repeatable behavior logging in and out. Here is a summary of my findings:

    a) The only URL that can login and logout every other URL is site-1.com/system/. But after logging in from here, logging out from any other domain does not work.

    b) Logging in from site-1.com/cp-mask or site-1.com logs in all of site-1 does not login anywhere on site-2. And logging out from site-1.com/cp-mask/ or site-1.com works between the mask and front-end, but logging out from site-1.com/system/ does not work.

    c) Logging in from site-2.com/cp-mask/ or site-2.com logs in all of site-2 does not login anywhere on site-1.

    I’ve attached a screenshot of my spreadsheet for reference.

    I would like to set it up so logging in and out from any one of the 5 URLs would be reflected in the other 4. But if that’s not the way it’s supposed to work, what is most important to what I’m doing is that the front-end logins at site-1.com and site-2.com work together.

    Help would be appreciated!

  • #2 / May 23, 2011 5:14pm

    Sue Crocker

    26054 posts

    Hi, Shawn.

    Thanks for the detailed layout. The only thing you failed to mention is the version/build of EE.

    Can you tell us which version/build of EE2.x you’re using? See EEWiki:// HowTo Determine My EE Version

    Did you use something like this:

    $conf['multi_login_sites'] = "http://www.example.com/|http://www.sitetwo.com";

    -or-

    $config['multi_login_sites'] = "http://www.example.com/|http://www.sitetwo.com";
  • #3 / May 23, 2011 8:47pm

    Shawn Dai

    76 posts

    Hi Sue, I knew I forgot something!

    Yes, I’m using EE 2.1.3 Build 20110411.

    I am also using

    $config['multi_login_sites']
  • #4 / May 24, 2011 4:35pm

    Sue Crocker

    26054 posts

    Let’s also see a list of what you have in the individual index.php files for the secondary and third site.

    Are you using cookies and sessions, or just cookies? Is it the same for all three sites?

  • #5 / May 25, 2011 1:17pm

    Shawn Dai

    76 posts

    To clarify, there are only 2 sites, and both are using cookies only.

    I think the pertinent items you’re looking for in index.php are as follows:

    site-2.com

    $assign_to_config['site_name'] = 'second_site';
    $assign_to_config['cp_url'] = 'http://site-2.com/system/index.php';
    $assign_to_config['site_url'] = 'http://site-2.com/';

    site-2.com/cp-mask/

    $assign_to_config['site_name']  = 'second_site';
    $assign_to_config['cp_url'] = 'https://site-2.com/cp-mask/index.php';
  • #6 / May 25, 2011 1:57pm

    Sue Crocker

    26054 posts

    See the second site? It shouldn’t be using /system/index.php It should be using the masked control panel.

  • #7 / May 25, 2011 3:59pm

    Shawn Dai

    76 posts

    My bad—I mistyped. For site-2.com, I had the site-1.com/system/ control panel like:

    $assign_to_config['cp_url'] = 'https://site-1.com/system/index.php';

    But for good measure, I just tried to use what you suggested like:

    $assign_to_config['cp_url'] = 'https://site-2.com/cp-mask/index.php';

    That doesn’t change anything though.

  • #8 / May 26, 2011 5:52pm

    Brandon Jones

    5500 posts

    Shawn,

    Have you set a cookie domain for each site?

  • #9 / May 27, 2011 12:27am

    Shawn Dai

    76 posts

    Hi Brandon, thanks, I did not have that set!

    I read that documentation as having the opposite effect (restricting cookies to subdomains).

    Set it as you suggested, and now the MSM works exactly like I want. Login to any 1 of the 5 domains, and the other 4 are logged in too. The same applies to logout.

    Problem solved, you can close this thread out.

    Thanks again.

  • #10 / May 27, 2011 5:25pm

    Sue Crocker

    26054 posts

    Whew, glad things are working again. If anything else comes up, please do let us know in a new thread..

.(JavaScript must be enabled to view this email address)

ExpressionEngine News!

#eecms, #events, #releases