[resolved] Single Login across Multiple WordPress Installations (7 posts)

  1. alkafy
    Posted 8 years ago #


    Previous threads have helped me share users between two WordPress installs, but I ran into a problem: When a user logs into one, they're not logged into the other (and vice versa.) I'd really like to transfer the session between the two and only require users to log in once.

    Here's what I did to share users, if it's helpful. "Secondary" refers to the WordPress Installation residing within a subdirectory of the "Primary" WordPress Installation:


    define(‘CUSTOM_USER_TABLE’, ‘wp_users’);
    define(‘CUSTOM_USER_META_TABLE’, ‘wp_usermeta’);

    to wp-config.php in Secondary WordPress root.

    $this->cap_key = $wpdb->prefix . ‘capabilities’;


    $this->cap_key = ‘wp_capabilities’;

    in capabilities.php in wp-includes of Secondary WordPress install

    Thank you for all your help!

  2. Jeremy Clark
    Posted 8 years ago #

  3. I'd really like to transfer the session between the two

    WordPress does not use sessions, and if the URL's of the two sites are on different domains, then the cookies cannot be passed from one to the other (browser security restrictions). Therefore what you want is not possible in such a case.

    In multiple folders on the same domain, it can be done, as shown by the link given above.

  4. alkafy
    Posted 8 years ago #

    I'm sorry, I wasn't sure which method WordPress used.

    In any case, the recommended solution worked without a hitch and I'm very impressed with its simplicity. Thank you, thank you.

  5. Anonymous
    Posted 8 years ago #

    Thanks, it works for me.

  6. flywitness
    Posted 7 years ago #

    the solution linked to is unsolved for 2.6 but closed for comments.

    Does anybody know how this might be done in 2.6.1?

    I'm sure this must be a common situation. I just want one set of cookies that cover the whole domain. I can't ask users to re-login to every part of the site!

  7. flywitness
    Posted 7 years ago #

    i did it in wordpress 2.6 like this:


    cheers ta

Topic Closed

This topic has been closed to new replies.

About this Topic