share user cookie between two blogs within same domain.
-
Currently i am running two blogs off of the same domain 1st installation is installed on https://www.maindomain.com second installation is on https://www.maindomain.com/blog
they are on same single database with different prefix.
How do i make it so when one logs on to https://www.maindomain.com it automatically logs me on to https://www.maindomain.com/blog.
i’ve tryed using this code on wp-config.php (tryed putting both installs wp-config, tryed single.
anyideas?
$baseurl = ‘https://www.maindomain.com’;
$cookiehash = md5($baseurl);
define(‘COOKIEHASH’, $cookiehash);
define(‘USER_COOKIE’, ‘wordpressuser_’ . COOKIEHASH);
define(‘PASS_COOKIE’, ‘wordpresspass_’ . COOKIEHASH);
define(‘COOKIEPATH’, preg_replace(‘|https?://[^/]+|i’, ”, $baseurl . ‘/’ ) );
define(‘SITECOOKIEPATH’, preg_replace(‘|https?://[^/]+|i’, ”, $baseurl . ‘/’ ) );
- The topic ‘share user cookie between two blogs within same domain.’ is closed to new replies.