Cookies in multisite where network sites have their own domain name

I decided to integrate several stand alone WordPress websites into a single multisite installation.

I created a brand new multisite install with subdirectories, created a MU network site with subdirectory URL, and exported the content from the original standalone site, then imported that content into the subdirectory MU site.

I then removed the original standalone site from cPanel, and set the MU site’s domain name to the original domain name.

The site loads on its original domain name, but when I try to login to domainname.com/wp-admin (using the brand new multisite’s network admin user credentials), I receive an error:

ERROR: Cookies are blocked or not supported by your browser. You must
enable cookies to use WordPress.

Cookies are enabled in Chrome.

I tried adding the following to wp-config.php:

define('COOKIE_DOMAIN', false);

but the issue remains.

The same issue occurs if I use WP Migrate DB Pro, to pull in a standalone website into a MU subdirectory site, then delete the standalone site from cPanel, and then set the MU subdirectory site’s URL to be the original standalone site’s domain name. The site’s front end loads fine, I just can’t login to admin.

Help appreciated.

1
13

First Clear Browser Cache (including cookies) + server cache from cache plugins etc.

Then set the following in your wp-config.php file:

define('ADMIN_COOKIE_PATH', "https://wordpress.stackexchange.com/");
define('COOKIE_DOMAIN', '');
define('COOKIEPATH', '');
define('SITECOOKIEPATH', ''); 

Also, you may checkout the answer from HERE:

define('WP_ALLOW_MULTISITE', true);
define('MULTISITE', true);
define('SUBDOMAIN_INSTALL', false);
define('DOMAIN_CURRENT_SITE', 'your-domain.com');
define('PATH_CURRENT_SITE', "https://wordpress.stackexchange.com/");
define('SITE_ID_CURRENT_SITE', 1);
define('BLOG_ID_CURRENT_SITE', 1);
define('SUNRISE', 'on');

If it still fails, then read this answer or contact your server support, there may be a configuration issue in the server.

Leave a Comment