Published in WordPress
avatar
4 minutes read

Wordpress admin login cookies blocked error after moving servers

Foundation: had a functioning Wordpress 3.7 site at olddomain.com.

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

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

Presently when I endeavor to login from newdomain.com/wp-administrator I'm getting the cross-program mistake (notwithstanding having treats empowered and clearing existing treats):

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

I had a go at going into wp-login.php and remarking out the accompanying lines (744-747) to stop the contingent 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);

yet, doing that leaves me caught in a divert circle back to the administrator page:

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

Do I have to change (or not set) the site URL? or on the other hand is there one more possible method for investigating this? much appreciated

Solutions

add to wp-config.php

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

unique source http://wordpress.org/support/subject/treat blunder site-not-letting-me-sign in

Comments