Question

since yesterday I can no longer log in to the dashboard of my Wordpress sites. I can log in the main site. But when I go from the main site to the dashboard of another site of the multisite setup, I get a login screen. When I log in I get the error:

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

I am using WordPress 3.8. It runs behind Varnish, maybe that is causing it. I have already overwritten the wp-login.php file. I have network disabled all the plugins. The only thing that temporarily helped was adding the following to wp-config.php:

define('ADMIN_COOKIE_PATH', '/');
define('COOKIE_DOMAIN', '');
define('COOKIEPATH', '');
define('SITECOOKIEPATH', '');

I could then go to the dashboard of the other site without needing to enter my log in details. However when I commented the above lines the same error occurred.

My Varnish default.vcl file is:

backend default {
  .host = "127.0.0.1";
  .port = "4040";
}

backend tomcat {
  .host = "127.0.0.1";
  .port = "8080";
}

#Enable compression
sub vcl_recv {
  if (req.http.Accept-Encoding) {
    if (req.url ~ "\.(jpg|jpeg|png|gif|gz|tgz|bz2|tbz|mp3|ogg)$") {
      # No point in compressing these
      remove req.http.Accept-Encoding;
    } elsif (req.http.Accept-Encoding ~ "gzip") {
      set req.http.Accept-Encoding = "gzip";
    } elsif (req.http.Accept-Encoding ~ "deflate" && req.http.user-agent !~ "MSIE") {
      set req.http.Accept-Encoding = "deflate";
    } else {
      # unknown algorithm
      remove req.http.Accept-Encoding;
    }
  }
}

Does anybody know a solution? Thanks.

Kind regards,

Nick

Was it helpful?

Solution

I have found a work around for my problem but I do not know whether or not it has any side effects. I have added a line to my wp-config.php file:

define('COOKIE_DOMAIN', '');

When I now switch to the dashboard of another domain (FQDN), I get the login screen, once logged in I stay logged in after switching back and forth from dasboards from several domains.

OTHER TIPS

make sure that you have defined correct domain for main site :

define('DOMAIN_CURRENT_SITE', 'yourmainsite.com');

it located on wp-config.php

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top