Support » Plugins » Share session for multiple wp installs

  • Resolved Haller


    Lo everyone,

    I’ve successfully installed 2 separate wp install which share their users and user_meta tables. I’ve done this by making changes which can be found here:
    An extra note to these changes: Go to both (depending on the number of wp installs running, in my case 2) option tables and find the option with option_name [your_prefix]_user_roles and rename this to user_roles. If you don’t do this no user will be able to log in.

    Now my question. Is it possible to share the session so that an user doesn’t have to login again when switching from one install to the other?


Viewing 2 replies - 1 through 2 (of 2 total)
  • First of all its not sharing a session but sharing a cookie…

    Like I said before I have 2 seperate WP installation running which are sharing the tables users and user_meta.
    They are located in /myfolder/nl/ and /myfolder/en/.


    Insert the following code in your wp-config.php file just before require_once(ABSPATH.’wp-settings.php’);

    define('COOKIEPATH', '/myfolder/'); //set this to the folder where all WP installs are located
    define('SITECOOKIEPATH', '/myfolder/'); //set this to the same folder as COOKIEPATH, otherwise multiple cookies will be set with different paths
    $cookiehash = md5(""); //create cookie hash, if not done WP will not read the cookie set on the other WP install
    define('COOKIEHASH', $cookiehash); //define the hash

    Now if I log in at and switch to im loggedin!

    Thats all Folks… ( Funny how I can say that after 10 cups of coffee and no hair on my head 😛 )

    I can’t seem to get this to work on 2.6. I’m trying to use the cookie across a root install and a subfolder install, for example:

    Assuming that the above fix works for this situation, do I change the code in config.php for both installs? What could I be doing wrong here?

    Any help would be much appreciated.

Viewing 2 replies - 1 through 2 (of 2 total)
  • The topic ‘Share session for multiple wp installs’ is closed to new replies.