• After enabled the WordPress Multisite Domain Mapping, my main domain (site) is
    example.com and sub-site uses example2.com as the siteURL. Both sites are displaying content, and the main site is working without no login problem. But after I logged into the main site and switched to the sub site dashboard, I got the login page redirection. The logon error was about the cookie issue. Anybody had the same login problem after using the domain mapping?

Viewing 6 replies - 1 through 6 (of 6 total)
  • Try clearing your cookies or use another browser.

    I have a similar problem.

    I recently set up a multisite with domain mapping. I have five sites under subdomains, and two sites under domain mapping.

    In the beginning, everything worked fine. But now suddenly, I cannot reach the dashboard of my mapped sites. Whenever I try, I’m redirected to the login page, and login is not accepted because “cookies are blocked”.

    I have no problem reaching the dashboard of the five subdomain sites.

    I tried doing this in both Firefox and Chrome, with the same results. I also tried to clear my cookies.

    I’m running WP4.8 without domain mapping plugin (i.e. only through the built-in mapping feature). I tried to change “define( ‘COOKIE_DOMAIN’, ” );” in wp-config, but it didn’t help.

    Anybody has a solution?

    Okay, I searched around on the Internet and found a “solution”:

    I deleted the line: “define( ‘COOKIE_DOMAIN …” in config.php and instead added these four lines:

    define(‘ADMIN_COOKIE_PATH’, ‘/’);
    define(‘COOKIE_DOMAIN’, ”);
    define(‘COOKIEPATH’, ”);
    define(‘SITECOOKIEPATH’, ”);

    That means that I can log into all sites. But I have to log in again each time I want to switch between sites, which is not ideal.

    Anobody knows how to do this in a better way?

    I finally solved my problem!

    In config, I added the following line:
    define(‘COOKIE_DOMAIN’, ‘.mydomain.com’);

    (Important: Note dot in front of mydomain.)

    That solved all my problems.

    Thread Starter superit

    (@superit)

    you meant all problems were resolved, including the domain mapping ones?

    I used another solution as the below:

    define(‘COOKIE_DOMAIN’, $_Server[‘HTTP_HOST’]);

    Well, actually, in the end I gave up. I thought that I had solved the problem several times, but for some unexplicable reason, the problem surfaced again after I had logged out and in a couple of times. Really strange. I tried all possibilities, including the one you mention.

    So, in the end I gave up and instead installed the plugin for domain mapping. Now it’s working perfectly. But no matter how hard I tried, I couldn’t get the native domain mapping feature to work correctly.

Viewing 6 replies - 1 through 6 (of 6 total)
  • The topic ‘Could not log in after mapping the domain in netwoking’ is closed to new replies.