Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Wordpress admin login cookies blocked error after moving servers

Tags:

Background: had a working Wordpress 3.7 site at olddomain.com.

I moved it to newdomain.com successfully, and in the process added this to wp-config:

define('WP_HOME','http://newdomain.com'); define('WP_SITEURL','http://newdomain.com'); 

Now when I attempt to login from newdomain.com/wp-admin I'm getting the cross-browser error (despite having cookies enabled and clearing existing cookies):

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

I tried going into wp-login.php and commenting out the following lines (744-747) to stop the conditional testcookie check

    // If cookies are disabled we can't log in even with a valid user+pass if ( isset($_POST['testcookie']) && empty($_COOKIE[TEST_COOKIE]) )     $user = new WP_Error('test_cookie', __("<strong>ERROR</strong>: Cookies are blocked or not supported by // your browser. You must <a href='http://www.google.com/cookies.html'>enable cookies</a> to use WordPress.")); else     $user = wp_signon('', $secure_cookie); 

but doing that leaves me stuck in a redirect loop back to the admin page:

http://myapp.com/wp-login.php?redirect_to=http%3A%2F%2Fmyapp.com%2Fwp-admin%2F&reauth=1 

Do I need to change (or not set) the site URL? or is there another potential way to troubleshoot this? thanks

like image 694
Chris B. Avatar asked Jan 06 '14 00:01

Chris B.


People also ask

How do I fix cookies blocked error on WordPress dashboard?

To fix the “Cookies are blocked or not supported by your browser. You must enable cookies to use WordPress.” error, we recommend disabling your caching and security plugins, and seeing if you can log into your WordPress admin dashboard.

Can't log in error cookies are blocked or not supported by your browser you must enable cookies to use WordPress?

You must enable cookies to use WordPress.” To fix that, temporarily deactivate the security & cache plugin by renaming the plugin's folder. To do so, login to your website via FTP or a file manager plugin, and then rename the specific folder /wp-content/plugins/plugin-name to something else.


1 Answers

add to wp-config.php

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

original source http://wordpress.org/support/topic/cookie-error-site-not-letting-me-log-in

like image 170
max4ever Avatar answered Sep 28 '22 06:09

max4ever