Skip to main content
OverflowAI is here! AI power for your Stack Overflow for Teams knowledge community. Learn more
44 votes

Can't log in: "ERROR: Cookies are blocked or not supported by your browser. You must enable cookies to use WordPress."

Add below line to your wp-config.php before /* That's all, stop editing!...*/ define('COOKIE_DOMAIN', $_SERVER['HTTP_HOST'] ); /* That's all, stop editing! Happy blogging. */
wpdevramki's user avatar
37 votes
Accepted

Cookies in Multisite network where sites have their own domain name?

First clear your browser's cache (including cookies), and your server's cache (e.g. cache plugins). Then set the following in your wp-config.php file: define('ADMIN_COOKIE_PATH', '/'); define('...
Scott's user avatar
  • 1,315
10 votes
Accepted

Why does it say: 'Cookies are blocked or not supported'?

When you log in to the admin WordPress sets cookies (in PHP) to keep you logged in while you navigate around your site. If this fails, you get the error message, "Cookies are blocked or not supported ...
MikeNGarrett's user avatar
  • 2,661
9 votes

Cookies in Multisite network where sites have their own domain name?

Using WordPress version 4.9.4. I was getting the cookie error and looked through various help options and eventually solved it by using a parts of Scott's fix. (Note: I didn't do any cookie cache ...
user140609's user avatar
8 votes

COOKIE_DOMAIN setting confusion

I have been struggling with using the multisite domains of native 4.x wordpress. Despite finding references, saying these lines corrected the error, neither of these setting worked: //define('...
Wayne Brian Pearsall's user avatar
7 votes

How to share cookies and sessions between domain and subdomain?

I'll skip steps related to sharing DB and sharing users data and meta, based on assumption that you've done it correctly. Let's concentrate on wp-config.php of both sites. These are defines that MUST ...
Frank P. Walentynowicz's user avatar
6 votes
Accepted

How does REST API cookie authentication work in WP 4.7?

It looks like you're missing the nonce part, as explained in the Authentication chapter, in the REST API Handbook: Cookie authentication is the basic authentication method included with WordPress....
birgire's user avatar
  • 67.3k
5 votes
Accepted

How does the "authentication unique keys and salts" feature work?

Basically, they're hashing salts. They're used to make the results of hashing much less predictable. See https://en.wikipedia.org/wiki/Salt_(cryptography) for info on salts. AUTH is used for the /wp-...
Otto's user avatar
  • 32.6k
5 votes
Accepted

Gravity Forms skip form if already filled out using cookie?

Here's some code on how you could simply leverage the gform_after_submission hook of Gravity Forms to set a cookie based on your form ID once submitted, then check for that on the confirmation page by ...
brianjohnhanna's user avatar
5 votes
Accepted

Set cookie using GET variable

Just check if the variable is set, using the code from your link: add_action( 'init', 'set_agent_cookie' ); function set_agent_cookie() { if (isset($_GET['code'])) { $name = 'agent'; ...
David Lee's user avatar
  • 3,871
5 votes

Passing Additional Parameters to add_filter Callable

The second parameter in add_filter is a function with accepted arguments, not returned values. This is an example how I pass my custom array $args to change an existing array $filter_args: ...
Ryszard Jędraszyk's user avatar
5 votes
Accepted

Remove Cookies From Wordpress Core

You won't be able to log in to WordPress at all without cookies. It's not just about remembering if you're logged in the next day, it's about remembering if you're logged in every time you go to a ...
Jacob Peattie's user avatar
4 votes

How to Layer 7 Load Balance WordPress Backend and Frontend?

The problem #1 & #2: Don't know why you need to add and validate extra cookies, but for me, it's simple and quite straight forward: This is what I have tried on vagrant boxes and with default ...
wpclevel's user avatar
  • 3,419
4 votes
Accepted

Getting "Cookies are blocked or not supported by your browser" on login page

Wrangled up some things to check: @otto via comment on this post Look at the login page's HTML source. Is there anything at all before the initial DOCTYPE line? Even a blank line? If so, then ...
Dave Romsey's user avatar
  • 17.7k
4 votes

Cookies in Multisite network where sites have their own domain name?

Finally after hours, literally, of troubleshooting I was able to get this resolved on the AWS Lightsail Bitnami Multisite Wordpress (WordPress 5.0.4) instance by performing the following: Ensure the ...
George Drew's user avatar
4 votes

Setting Cookie with init hook causes 'header already sent'

It’s a problem as old as WP, or even older... You can’t set cookies, or send any other headers, if any of the content of the site is already sent. You try to set cookies using init hook. And it is ...
Krzysiek Dróżdż's user avatar
4 votes
Accepted

Rest API authentication issue when called from fetch request in bundle.js

The problem is that you're not using the correct name for the REST API nonce header — the correct name is X-WP-Nonce, but you used X-WP-Header: fetch('http://localhost/wptest2/?rest_route=/wp/...
Sally CJ's user avatar
  • 39.2k
4 votes

Login redirect_to loop with reauth=1, cookie expiry set to 1 year in past

This was caused simply by the salts in wp-config.php being at the end of the file, after the call to wp-settings.php (they were inserted by an Ansible script) rather than above the line: /* That's ...
William Turrell's user avatar
4 votes
Accepted

What is cookie "U" from domain ".adsymptotic.com" found on the WordPress page?

It's from LinkedIn. It's listed here: https://www.linkedin.com/legal/l/cookie-table
Jacob Peattie's user avatar
4 votes

Modify the third (context) parameter in a filter?

You can't modify the parameters of a filter like that, that's not what they're there for. In the source code it'll look something like this: $cookie = apply_filters( $cookie, $user_id, $expiration, $...
cameronjonesweb's user avatar
3 votes

Keep Users Logged In As Long As I Like

What you found is actually perfectly accurate. With WP's commitment to backwards compatibility it's not that common for thing to stop working. This filter is used in wp_set_auth_cookie() to calculate ...
Rarst's user avatar
  • 99.6k
3 votes

Deleting cookie to logout

Is there something additional that wp_logout does? As I said in my comment, WordPress runs two functions on wp_logout. wp_destroy_current_session() wp_clear_auth_cookie() wp_clear_auth_cookie() ...
N00b's user avatar
  • 2,169
3 votes

How to run a function in every page, every device

Generally functions hooked with init action will be available on every page and posts with in WordPress. it will immediately fire upon WP load. so maybe something like below will work. function ...
Anwer AR's user avatar
  • 1,007
3 votes

How am I able to get the value out of cookie array when I push a button?

You need to put the id of each item inside form to indicate the item that will be deleted. <?php $all_favorites= unserialize($_COOKIE['favorites']); echo '<table>'; foreach($all_favorites ...
Laxmana's user avatar
  • 1,332
3 votes

Two posts are loaded instead of one?

The core of the problem is that you set cookies when the content is being accessed, not when it is read. Browsers can try to prefetch content, and your description sound like the browser is ...
Mark Kaplun's user avatar
  • 23.4k
3 votes
Accepted

How to set a Cookie-Free Domain with WordPress?

Your mistake is the WP_CONTENT_URL's postfix. You should set the definitions in the following manner: define("COOKIE_DOMAIN", "www.artisanplombier-pascher.com"); define("WP_CONTENT_URL", "https://...
snowflake's user avatar
3 votes
Accepted

Should wordpress_logged_in cookie exist while logged out?

The function wp_logout (https://github.com/WordPress/WordPress/blob/master/wp-includes/pluggable.php#L564) calls the function wp_clear_auth_cookie (https://github.com/WordPress/WordPress/blob/master/...
Philipp Zedler's user avatar
3 votes
Accepted

wp_validate_logged_in_cookie

wp_validate_logged_in_cookie() comment from source: /** * Validates the logged-in cookie. * * Checks the logged-in cookie if the previous auth cookie could not be * validated and parsed. * * ...
hwl's user avatar
  • 2,135
3 votes

Passing Additional Parameters to add_filter Callable

Am I misunderstanding how add_filter is supposed to work? Yes, you are. The function ( aka callback function ), specified by name, in the second parameter of add_filter(), NEVER passes ANY ...
Frank P. Walentynowicz's user avatar
3 votes
Accepted

How to get session token of current user in wp_login hook?

You can't access the $_COOKIE in this hook. You can only access $_COOKIE after the page HTTP headers are set with the $_COOKIE its mean in the next page. You have other hook that you can hook into to ...
Shibi's user avatar
  • 1,833

Only top scored, non community-wiki answers of a minimum length are eligible