WP plugin W3TC causing login redirect loop

I first noticed this issue when visiting my blog on my phone forced me to login again. No matter how many times I submitted the form, I was taken back to wp-login.php — with a redirect to go to /wp-admin/.

I tried multiple solutions:

  • Resetting WordPress salt keys, thus logging me out everywhere
  • Not forcing SSL on login

But it wasn’t until I thoroughly looked over wp-config.php, specifically at the top, and removed this line created by W3 Total Cache that I was able to login and escape the redirect loop:

define('COOKIE_DOMAIN', 'lemonandlively.com'); // Added by W3 Total Cache

😤 May this issue never happen again. I was about to have a meltdown.

Leave a comment