close

How to fix “set SameSite cookie to none” warning?

Hello Guys, How are you all? Hope You all Are Fine. Today we are talking about How to fix “set SameSite cookie to none” warning? in php. So Here I am Explain to you all the possible solutions here.

Without wasting your time, Let’s start This Article to Solve This Error.

Today we are talking about How to fix “set SameSite cookie to none” warning? in php.

  1. How To Solve fix “set SameSite cookie to none” warning Error ?

    To Solve fix “set SameSite cookie to none” warning Error As the new feature comes, SameSite=None cookies must also be marked as Secure or they will be rejected.

  2. How to fix “set SameSite cookie to none” warning?

    To Solve fix “set SameSite cookie to none” warning Error As the new feature comes, SameSite=None cookies must also be marked as Secure or they will be rejected.

Solution 1

If you are experiencing the OP’s problem where your cookies have been set using JavaScript – for example:

document.cookie = "my_cookie_name=my_cookie_value; expires=Thu, 11 Jun 2070 11:11:11 UTC; path=/";

you could instead use:

document.cookie = "my_cookie_name=my_cookie_value; expires=Thu, 11 Jun 2070 11:11:11 UTC; path=/; SameSite=None; Secure";

Solution 2

As the new feature comes, SameSite=None cookies must also be marked as Secure or they will be rejected.

One can find more information about the change on chromium updates and on this blog post

Note: not quite related directly to the question, but might be useful for others who landed here as it was my concern at first during development of my website:

if you are seeing the warning from question that lists some 3rd party sites (in my case it was google.com, huh) – that means they need to fix it and it’s nothing to do with your site. Of course unless the warning mentions your site, in which case adding Secure should fix it.

Summery

It’s all About this issue. Hope all solution helped you a lot. Comment below Your thoughts and your queries. Also, Comment below which solution worked for you? Thank You.

Also, Read

Leave a Comment