Cookies are blocked or not supported by your browser after migrating server
-
I’ve migrated yesterday a WordPress site from an old server
PHP 5.6.x, low RAM, disk 97% to a new server with
PHP 7.4.x, 32gb RAM, 2tb disk, etc.Site was working great. After migrating, I’ve got the
“Cookies are blocked or not supported by your browser” error when trying to login to dashboardThis is what I’ve tried so far (without any luck)
1) wp-config.php (chmod is ok 644 same as wp-admin folder)
define( 'COOKIE_DOMAIN', '.mysite.org' );
2) wp-config.php
“home” and “siteurl” are both set in wp-config.php and database wp_options (site never had ssl)define('WP_HOME','http://www.mysite.org'); define('WP_SITEURL','http://www.mysite.org');
3) wp-config.php
define('ADMIN_COOKIE_PATH', '/'); define('COOKIE_DOMAIN', ''); define('COOKIEPATH', ''); define('SITECOOKIEPATH', ''); // also tried adding this line define('COOKIE_DOMAIN', $_SERVER['HTTP_HOST'] );
4) wp-config.php
define('COOKIE_DOMAIN', false);
5) tried renaming wp-content/plugins folder
renamed/erased plugins folder and tried login again6) tried renaming wp-content/themes folder
renamed/erased themes folder and tried login again7) added code at end of wp-content/themes/myactivetheme/functions.php
setcookie(TEST_COOKIE, 'WP Cookie check', 0, COOKIEPATH, COOKIE_DOMAIN); if ( SITECOOKIEPATH != COOKIEPATH ) setcookie(TEST_COOKIE, 'WP Cookie check', 0, SITECOOKIEPATH, COOKIE_DOMAIN);
8) delete .htaccess
9) manually enabled cookies for domain in chrome/firefox. Tried anonymous windows, etc.
10) checked wp-config.php encoding
Open up wp-config.php
Remove any space or anything before the <?php
Remove anything after the ?>
Make sure the encoding is UTF-8 (Without BOM)11) add debug code to wp-login.php
add_action( 'login_init', 'my_login_init' ); function my_login_init() { echo '<b>Cookie path:</b> '; var_dump( COOKIEPATH ); echo '<br /><b>Cookie site path:</b> '; var_dump( SITECOOKIEPATH ); echo '<br /><b>Cookie domain:</b> '; var_dump( COOKIE_DOMAIN ); echo '<br /><b>Admin cookie path:</b> '; var_dump( ADMIN_COOKIE_PATH ); }
Result:
Cookie path: string(0) “”
Cookie site path: string(0) “”
Cookie domain: string(0) “”
Admin cookie path: string(1) “/”Note: There’s no caching plugin installed
I would not like to start the site again from scratch. It was lot of work
Thanks for any tip
- The topic ‘Cookies are blocked or not supported by your browser after migrating server’ is closed to new replies.