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?
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("http://www.yourdomain.com/myfolder"); //create cookie hash, if not done WP will not read the cookie set on the other WP install define('COOKIEHASH', $cookiehash); //define the hash
Thats all Folks… ( Funny how I can say that after 10 cups of coffee and no hair on my head 😛 )
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.
- The topic ‘Share session for multiple wp installs’ is closed to new replies.