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
A cookie associated with a cross-site resource was set without the `SameSite` attribute
提问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 withSameSite=NoneandSecure.
与http://quilljs.com/上的跨站点资源关联的 cookie 设置为没有该
SameSite属性。未来版本的 Chrome 将仅在跨站点请求中使用SameSite=None和设置 cookie 时才传送 cookieSecure。
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-explained和https://web.dev/samesite-cookie-recipes 获得。

