Cookies not setting for Sub Sites (Multi Mapping + Multi Domains)

Hello,

Domain Mapping 4.1.1
Multi Domains 1.3.1
Pro Sites 3.4.1

First of all, it's imperative that Domain Mapping works, so I am using DM's sunrise.php.

Second, I have 6 domains tied to Multi-Domains on the WPMU install. The main domain is set to private, so user's cannot create sites on that domain. The other 5 domains are public.

My superadmin created 2 sub sites on a public domain. I can view the sites, but I cannot log into them. I get this error:

ERROR: Cookies are blocked or not supported by your browser. You must enable cookies to use WordPress.

I looked at the cookies on the browser, and indeed it's not creating cookies even when I visit the sub sites. My browser only has cookies for the main site where I logged in as Superadmin.

This is the same behavior whether Single Signon is ON or OFF.

I've toggled these wp-config.php settings (comment, uncomment), but I still cannot log in.

define('DOMAIN_CURRENT_SITE', 'domain.com');
define('PATH_CURRENT_SITE', '/');
define('SITE_ID_CURRENT_SITE', 1);
define('BLOG_ID_CURRENT_SITE', 1);

This WPMU install is on the ROOT folder of the IP. All of my domains are pointing to the root folder, including their wildcard subdomains.

I think I've tried everything, but still not working.

Please help.

    Eve

    There is a clear conflict between the two sunrise.php files (Multi Domains and Domain Mapping).

    Like I said earlier, Domain Mapping needs to work no matter what. I have live domains on there that are mapped to the WPMU install.

    But for troubleshooting's sake, when I use the multi-domain/sunrise.php, I CAN log into the sub sites, BUT then domain mapping STOPS WORKING. And that simply is not acceptable.

    Isn't there a way to make these two files compatible at all times on the most current versions of this plugin? I find that this is the major cause of down time whenever there are updates to these plugins.

    It causes a support nightmare between me and my users

    Eve

    I did a hack and it seems to be working...

    I merged the two sunrise.php files. The Domain Mapping version is at the top of the file, while the Multi Domains version is at the bottom of the file.

    I can use the admin dashboard on the sub sites, AND my mapped domains are still working.

    For future versions, can you let us know which sunrise.php version takes precedence?

    Also, perhaps it's better to create two constant variables of SUNRISE, one for each plugin. That way, there's no breaking what's working (domain mapping), and we can use the two plugins independently or together.

    Whatever the development choice, please end this ongoing conflict with these two plugins. I beg you.

    aristath

    Hello there @alwaysonline, I hope you're well today!

    You don't have to change anything manually...

    First delete the sunrize.php fie (or simply rename it so that you keep it as a backup).

    Make sure that the wp-content folder is writable by your webserver.

    Install the domain mapping plugin as instructed on its usage page on https://premium.wpmudev.org/project/domain-mapping/#usage

    Before copying the sunrise.php file, check if it has already been created by the plugin. It tries to do it automatically, so if you see it there there's no need to do anything.

    Make sure that this file is writable by your webserver and then install the multi-domains plugin.
    It should automatically do all that has be done as stated in https://premium.wpmudev.org/project/multi-domains/#usage

    As of Multi-Domains version 1.3, it is no longer necessary to manually install the plugin in the mu-plugins folder. Woot! If you have an older version in that folder now, please remove it.
    It is also no longer necessary to manually update the sunrise.php file as that is now done automatically.
    Finally, if you are also using our Domain Mapping plugin, be sure that it is at least version 4.0.3.

    I hope that helps!

    Cheers,
    Ari.

    Eve

    Interesting. That worked, amazingly.

    I renamed wp-content/sunrise.php
    I made wp-content writable
    I deactivated Domain Mapping
    Reactivated it. Saw that it wrote wp-content/sunrise.php
    Deactivated Multi Domains
    Reactivated it.

    I did a diff...

    diff plugins/multi-domains/sunrise.php sunrise.php
    diff plugins/domain-mapping/sunrise.php sunrise.php
    diff plugins/domain-mapping/sunrise.php plugins/multi-domains/sunrise.php

    ...and saw that all three sunrise files are different

    Checked that my domains were still being mapped
    Checked to make sure I can log into my sub sites

    --

    So the activation process modified wp-content/sunrise.php for me. Why you not say so?

    I'm not sure if the Usage areas of these plugins explain the above steps (I didn't look).

    Thanks for making this seamless.

    If we don't make wp-content writeable, what do we have to do manually to get to the same sunrise.php file integrity?

    aristath

    In normal WordPress installations it is already writable, you shouldn't have to do anything.
    I added the above steps just to be absolutely certain that it works in your case...
    If for example you are used to creating and editing files on a VPS while being logged-in as root via SSH (a process I do all the time), then it is imperative that you re-assign the www-data user and group (or whatever the webserver user/group is in your case) to these files so that the server can access and write to them.
    It was just so that you're on the safe side.

    Cheers,
    Ari.