Warning "Third-party cookie will be blocked. Learn more in the Issues tab"
Asked Answered
Y

5

39

I am learning React and when running the code, I am getting a warning 'Third-party cookie will be blocked. Learn more in the Issues tab' in the console (inspect). I am getting this warning in the console every second after running the code. The number of counts of this warning is increasing continuously every second. How can I stop this?

I tried to remove this, but I did not get a correct answer. I am expecting to remove this warning or at least stop the increasing count of this warning.

Yesteryear answered 17/2 at 10:24 Comment(4)
Are you getting this error in code terminal, right ? And, other than this, Are you calling any external API in your code while getting this warning ?Ima
Please provide enough code so others can better understand or reproduce the problem.Ima
As I understand, author is not looking for a cause to fix these. Most of the warnings today come from 3rd party packages and from Chrome extensions. The only solution today is to disable "warnings" level from Google Chrome console to get rid of these new warnings. #52731247Mosenthal
Google Analytics 4 seems to cause this warning, but not always. I don't see any obvious reasons why it only happens sometimes, even on the same site.Houlihan
G
11

You might want to look into the article Prepare for third-party cookie restrictions from Google where there is mentioned more details regarding third-party cookie restrictions where Chrome is going to block third-party cookies at the end of 2024.

Greyhound answered 14/3 at 17:14 Comment(0)
G
7

I don't know what is your application context, but I've received this warning in many of my apps where I was handling auth-cookies. The issue is that my cookies were structured like this:

enter image description here

It includes attributes that Google is indicating will no longer be supported.

Cookies with the SameSite=None; Secure and not Partitioned attributes that operate in cross-site contexts are third-party cookies. In future Chrome versions, reading third-party cookies will be blocked. This behavior protects user data from cross-site tracking.

Using SameSite=None isn't suitable for authentication cookies; you should opt for SameSite=Lax or SameSite=Strict depending on your application's requirements.

It's crucial for your frontend and backend to be within the same domain. For instance, my frontend runs on 127.0.0.1:5173, and my backend on 127.0.0.1:5000. This same rule applies to production servers as well.

Now, I dont receive this warning anymore enter image description here

See:

Godfearing answered 25/3 at 14:28 Comment(3)
why do we care what google sez?Signatory
@Signatory because Google writes the browser... websites operate within a browser.Slavery
Could you please explain how you changed the value of that cookie so it still works? When I just set the value to lax or strict my cookie isn't saved properly anymore and the user receives a new session during each and every request. I have a widget for other sites and my session cookie is ignored -> each request starts a new sessionBacciferous
L
5

If the message you are seeing is on the Console and you are in Chrome, you should have more info on the Issues tab (within the console)

enter image description here

Lankester answered 13/5 at 15:45 Comment(0)
B
1

There are no security settings in IITC Mobile to fix the cookie blocking.

Benedetto answered 26/2 at 17:25 Comment(1)
As it’s currently written, your answer is unclear. Please edit to add additional details that will help others understand how this addresses the question asked. You can find more information on how to write good answers in the help center.Extrusion
O
0

Something similar began to happen to me as well. The issue for me was using "Open With Live Server" on my code. Not sure if you are doing this or not but figured I'd put it out there just in case someone else comes along looking for the same answers I did :)

Outgo answered 22/3 at 21:30 Comment(0)

© 2022 - 2024 — McMap. All rights reserved.