The following error sometimes presents itself when trying to login to the subsite of a WordPress multisite:
“ERROR: Cookies are blocked or not supported by your browser. You must enable cookies to use WordPress.”
This may occur even if your browser does in fact have cookies enabled and it can happen when WordPress is serving all of your multi sites cookies from one domain, instead of each individual domain.
The fix is usually simple. Below is how to solve it.
Step 1. Connect to Your Server
You can connect to your server via SFTP or SSH. In this example, we’ll be looking at connecting to the server by SSH. Please see the following articles to get started:
Step 1. Generate your SSH Key
Step 2. Add your SSH Key to vCanopy (also see Add default SSH Keys)
Step 3. Connect to your server by SSH as Root user (we like and use Termius)
Step 2. Edit the “user-configs.php” FileWe’re going to place our code inside the
user-configs.phpfile. You can learn more about this file here:Migrations, Cloning, and the WordPress Configuration File (wp-config.php)The contents of this file is inserted directly into the
wp-config.phpfile using a PHP include statement. Any code added here will not be written over at any point by any vCanopy function and it will persist over migrations/clones.
EDIT THE FILEOpen the user-configs.php file for editing with the following command (replacing “site.url” with your websites domain name):
nano /var/www/site.url/user-configs.phpAdd the following to the file:
define('ADMIN_COOKIE_PATH', '/'); define('COOKIE_DOMAIN', ''); define('COOKIEPATH', ''); define('SITECOOKIEPATH', '');Now save the file with CTRL+O followed by Enter. Close the file with CTRL+X.
Step 3. Check Your Website
At this point, you’re all set! All that’s left is to test your website again in an incognito window to confirm you can now log in.