javascript 与跨站点资源关联的 cookie 设置为没有“SameSite”属性

声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow 原文地址: http://stackoverflow.com/questions/58830297/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me): StackOverFlow

提示:将鼠标放在中文语句上可以显示对应的英文。显示中英文
时间:2020-10-29 10:41:45  来源:igfitidea点击:

A cookie associated with a cross-site resource was set without the `SameSite` attribute

javascriptgoogle-chromecookiescross-sitesamesite

提问by Hooman Bahreini

Chrome is giving me the following warning:

Chrome 给了我以下警告:

A cookie associated with a cross-site resource at http://quilljs.com/was set without the SameSiteattribute. A future release of Chrome will only deliver cookies with cross-site requests if they are set with SameSite=Noneand Secure.

http://quilljs.com/上的跨站点资源关联的 cookie 设置为没有该SameSite属性。未来版本的 Chrome 将仅在跨站点请求中使用SameSite=None和设置 cookie 时才传送 cookie Secure

Note that quilljs.com is a 3rd party domain.

请注意,quilljs.com 是第 3 方域。

I have seen thesequestions, the answers on both questions are similar, some say something like this:

我看过这些问题,这两个问题的答案是相似的,有些是这样说的:

nothing to do with your code. its something their web servers will have to support.

与您的代码无关。这是他们的网络服务器必须支持的东西。

While others provide an answer like this:

而其他人提供了这样的答案:

response.setHeader("Set-Cookie", "HttpOnly;Secure;SameSite=Strict");

I am not sure if this is something that I need to fix in my website, or is it something that should be fixed on the 3rd party library?

我不确定这是我需要在我的网站上修复的问题,还是应该在 3rd 方库上修复的问题?

回答by rowan_m

The warning messages specifically call out the domain that's responsible for the cookie. In this case, it's quilljs.com. If that's your domain, then you need to update the cookie there. If it's a third-party service that you rely on, then it's that service that needs to update their cookies.

警告消息专门指出负责 cookie 的域。在这种情况下,它是quilljs.com. 如果那是您的域,那么您需要更新那里的 cookie。如果它是您依赖的第三方服务,则该服务需要更新其 cookie。

EditMore context is available at https://web.dev/samesite-cookies-explainedand https://web.dev/samesite-cookie-recipes.

编辑更多上下文可在https://web.dev/samesite-cookies-explainedhttps://web.dev/samesite-cookie-recipes 获得