• i have to re login when i switch dashboard from site1.com/wp-admin to site2.com/wp-admin.

    i have mapped test.site1.com to site2.com

    before mapping i switched from dashboard of from site1.com/wp-admin to test.site1.com/wp-admin without relogin but after domain mapping it asked relogin

    i have also added wp-config.php

    define( ‘COOKIEPATH’, $_SERVER[‘HTTP_HOST’] );
    define( ‘SITECOOKIEPATH’, $_SERVER[‘HTTP_HOST’] . ‘/’ );
    define( ‘ADMIN_COOKIE_PATH’, SITECOOKIEPATH . ‘wp-admin’ );
    define( ‘COOKIE_DOMAIN’, ” );

    but nothing worked

Viewing 2 replies - 1 through 2 (of 2 total)
  • Moderator bcworkz

    (@bcworkz)

    Network WP is not setup to handle separate domains per site, only separate subdomains. The problem is the supposed site2.com site has no way to access the login auth cookie from site1.com. Doing so would violate all sorts of security protections.

    Then how do third party tracking sites get their cookies you might ask? Because they have content on the primary site. I don’t write tracking code, so I’m fuzzy on the details. It would be possible to set a site2 cookie from site1 if set by referred script from site2. Whether such a cookie would be recognized as a valid site2 auth cookie, I don’t know. The point is your best chance is having site2 script set its auth cookie from the site1 login process.

    Thread Starter Rustamveer Singh

    (@rustamveer)

    @bcworkz
    ah, i will try doing something as you said. i will try to get AUTH_COOKIE and LOGGED_IN_COOKIE from site1.com and set them into site2.com

    i am not sure how i will do.

    Thank you for the help

Viewing 2 replies - 1 through 2 (of 2 total)
  • The topic ‘re login to switch dashboard after domain mapping’ is closed to new replies.