2 comments

  1. You can share user tables between different WordPress installations by installing the second site (“Site B”) to use the original site’s (“Site A”) database, then choosing to use an alternate table prefix during installation so as to keep the rest of the data separate.

    The second part of the problem is sharing login cookies between the two installations (what WordPress uses to keep track of login/”session” data). In order to do this, you must use the same cookie-path for both sites.

    After installation, open the wp-config.php file in Site B’s installation root, and add (or replace) the following lines shortly after the database configuration, modifying them as needed to fit your configuration:

    $cookiehash = md5("http://www.bradleycountypulse.com/");  // Use Site A's URL
    
    define(CUSTOM_USER_TABLE,'wp_users');           //Change 'wp' to match the prefix set during
    define(CUSTOM_USER_META_TABLE,'wp_usermeta');   //  Site A's installation
    define('COOKIEPATH', '/');                      //This path should reference Site A's root
    define('SITECOOKIEPATH', '/');                  //Should match 'COOKIEPATH'
    define('COOKIEHASH', $cookiehash );
    

    Note that this will only work if the two installations reside on the same domain (which yours do!).

    An alternate solution would be to setup the entire system as a single multisite installation.

    Still another solution (albeit one that requires more legwork) would be to employ custom page templates on a single installation.

  2. I have released a wordpress plugin based on the following article:

    http://subinsb.com/set-same-cookie-on-different-domains

    User Session Synchronizer allows you to keep the user logged in from one wordpress to another by synchronizing user data and cookie session based on a verified email.

    The user email is encrypted based on the current user ip and a secret key shared by the synchronized wordpress installations.

    You can find the plugin here:

    https://wordpress.org/plugins/user-session-synchronizer/

    And participate here:

    https://github.com/rafasashi/user-session-synchronizer

Comments are closed.