Getting an ERROR: Cookies are blocked error when logging in to a site on a different domain?

The problem was I had the old multi-site method, which used sunrise.php. I removed wpcontent/sunrise.php and the SUNRISE setting in wp-config.php I then added the relevent settings from the accepted answer on a similar question and it worked. define(‘ADMIN_COOKIE_PATH’, “https://wordpress.stackexchange.com/”); define(‘COOKIE_DOMAIN’, ”); define(‘COOKIEPATH’, ”); define(‘SITECOOKIEPATH’, ”);

Manipulating cookie on specific taxonomy archive page

After googling around I found the correct way to do it by using the ‘wp’ hook if (is_tax(‘term-country’)) add_action(‘wp’, ‘my_setcookie’); // my_setcookie() set the cookie on the domain and directory WP is installed on function my_setcookie(){ $path = parse_url(get_option(‘siteurl’), PHP_URL_PATH); $host = parse_url(get_option(‘siteurl’), PHP_URL_HOST); $expiry = strtotime(‘+1 month’); setcookie(‘location’, ‘my_cookie_value_3’, $expiry, $path, $host); }

Detecting $_GET parameters from any page + Cookie

This should work, though untested. <?php add_action(‘send_headers’, ‘affiliate_redirect’); function affiliate_redirect() { // it’s possible to use ‘if( !empty( $_GET[‘affid’]) )’ if( isset($_GET[‘affid’]) && ” != $_GET[‘affid’] ) { if( empty($_COOKIE[‘affid’]) ) setcookie(‘affid’, $_GET[‘affid’], time()+2592000, “https://wordpress.stackexchange.com/”); header(‘Location: http://mysite.com/about/’); exit; } }

WordPress Redirect based on the prescence of a cookie

why not use the init action hook: function has_my_cookie() { if (!is_admin()){ //Check to see if our cookie is set if not redirect to your desired page and set the cookie if ( !isset($_COOKIE[“sevisitor”])) { //setcookie setcookie(‘sevisitor’, 1, time()+1209600, “https://wordpress.stackexchange.com/”, “http://localhost/child/”, false); //Redirect wp_redirect( get_site_url().’/about-myself’ ); exit; } } } add_action(‘init’, ‘has_my_cookie’);

Hata!: SQLSTATE[HY000] [1045] Access denied for user 'divattrend_liink'@'localhost' (using password: YES)