与位于 http://doubleclick.net/ 的资源相关联的 cookie 设置了 `SameSite=None` 但没有设置 `Secure`。 Chrome 的未来版本

A cookie associated with a resource at http://doubleclick.net/ was set with `SameSite=None` but without `Secure`. A future release of Chrome

我有一个 .net core 2.2 项目,我在 google chrome 上收到此警告:

http://doubleclick.net/ was set with SameSite=None but without Secure. A future release of Chrome will only deliver cookies marked SameSite=None if they are also marked Secure. You can review cookies in developer tools under Application>Storage>Cookies and see more details at https://www.chromestatus.com/feature/5633521622188032 上的资源关联的 cookie。

我试图通过在 Startup.cs 中添加 headers 来解决这个问题(但它不起作用)

app.Use(async (ctx, next) =>
           {
               ctx.Response.Headers.Add("Set-Cookie", "HttpOnly;Secure;SameSite=Strict");

           });

查看 Whois 记录,我们可以看到 doubleclick.net 的所有者是 Google:http://whois.domaintools.com/doubleclick.net。 我猜你的网页上有 Google 个广告?

您无法删除警告,Google 的工作是在他们提供的 cookie 上修复他们的 cookie 设置。

对于这些警告中的任何一个,如果您不对域负责,则您不负责更新 cookie。 DoubleClick 团队(在 Google)将负责更新为来自 doubleclick.net.

的 cookie 设置 SameSite 属性的相关代码

此时,警告仅供参考,不会影响功能。在稳定 Chrome 中强制执行此行为要到 M80,目前目标是 2020 年 2 月。