Multisite Cookies are Blocked Login Error

Have you ever set up a multisite network, started working on setting up a new subsite, and then get the cookies are blocked login error?

Multisite cookies are blocked login error

I have, and it really didn’t make any sense.

The first thing I looked for was my browser’s cookies settings. First, I made sure cookies were enabled. Then I checked that cookies weren’t blocked on the site I was trying to log into.

How to check if cookies are enabled

Each browser is a little different, so I’ll break it out by some of the more common browsers.

Chrome

  • Click the three dots at the top right side of your address bar.
  • Select Settings.
  • Scroll to the bottom and click Show advanced settings…
  • Under Privacy, click the Content settings… button.
  • Make sure the button next to Allow local data to be set (recommended) is selected.
  • Make sure the check box next to Block third-party cookies and site data is not checked
  • Next, click the Manage exceptions… button.
  • Make sure the site you are trying to log into is not listed with a Block behavior.
  • Then, click Done on both windows and close the settings.

Firefox

  • Click the hamburger menu (three horizontal lines) to the right of the address and search bar.
  • Select Options.
  • Select the Privacy tab on the left.
  • Under History, select Use custom settings for history under the Firefox will menu.
  • Check the box next to Accept cookies from sites.
  • Set Accept third-party cookies to Always.
  • Set Keep until to they expire.
  • Next, click on the Exceptions button.
  • Make sure the site you are trying to log into is not listed with a Block status.
  • Click the Save Changes button.
  • Then, close your options tab.

Safari

  • Select Safari, then Preferences, then click Privacy.
  • Under Cookies and website data, select Always allow.
  • Then, close the preferences screen.

For me, none of those settings fixed the problem. I was able to log into other WordPress sites with no problem, so cookies were enabled.

Cookie settings in wp-config.php

The fix for me came in adding a few lines to my multisite’s wp-config.php file.

<?php
//Do not include the opening <?php tag
//Place the following four lines somewhere before the "That's all, stop editing! Happy blogging." line
define('ADMIN_COOKIE_PATH', '/');
define('COOKIE_DOMAIN', '');
define('COOKIEPATH', '');
define('SITECOOKIEPATH', '');

You may need to close your browser and try logging in again, but after that, you should be able to log in.

6 Comments

  1. Susanne on September 20, 2017 at 6:02 am

    Does this still work for you?
    Are you using domain mapping, and with or without plugin? Or subdomain? I can’t make this work. When I try this I get this message and a blank white page: “The constant “COOKIE_DOMAIN” is defined (probably in wp-config.php). Please remove or comment out that define() line.”

    • Scott DeLuzio on September 20, 2017 at 9:25 am

      Yes, this is still working for me. Actually, it’s working on this site right now. The domain mapping on this site is without a plugin. I can’t say for sure why it isn’t working on your site, but this support topic may help.

  2. Robert Siegfried on April 14, 2020 at 3:46 pm

    Hey, I am starting a web hosting business and this helped me fix the cookie error. Thank you for posting this, it was very helpful.

  3. […] Source: Multisite Cookies are Blocked Login Error – Scott DeLuzio […]

  4. Valerie Woelk on November 12, 2021 at 6:58 pm

    Scott,
    I have been monkeying around with this error for a week, on a multisite created from an old blog installation sorted into different category dedicated sites. Lots of hours of work were lost when I suddenly could not log in to the admin area. Thank you!

Leave a Comment





This site uses Akismet to reduce spam. Learn how your comment data is processed.