I understand that, if I use subdomains on a multisite, then WordPress has the built in function of keeping the users logged in.

The different domains are a must. These sites were set up using the built in "add a new site" feature of WordPress. (I did not use a plugin to set up the sites.) The sites work fine as they are, except I would like for a user who signs into abc.com be able to switch to def.com to still be logged in.

I have tried adding define('COOKIE_DOMAIN', ''); to my wp-config file.

Also I've tried.

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

and I've tried changing define('SUBDOMAIN_INSTALL', true); between true and false. I've tried as many variations of the above as I can think of. The only other solution I've seen mentioned was a SSO plugin which would allow users to use their google or Facebook logins to sign in, but we are not comfortable with this option.

(A note: When I looked this issue up, some people were getting error messages about cookies not working/not being allowed and I have not noticed any error messages to that effect.)

  • Have you tried this answer? – Aurovrata Apr 27 '18 at 7:32
  • it didn't work. I logged into the main domain and when I switched to a different one it asked me to log in again. – Kaye O'Malley Apr 28 '18 at 19:42
  • its important when you change cookie settings to clear your cache properly before testing any changes as your previous cookie will be cached. Keep in mind also that if you already have a live version of a website and you are upgrading the cookie settings to change your salt keys. this will ensure that previous visitors browsers will refresh their cookies. – Aurovrata May 1 '18 at 8:26

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.