1

尝试在 Cordova 应用程序中调用 localhost URL 我得到以下错误

A cookie associated with a cross-site resource at http://local_ip/ was set without the `SameSite` 
attribute. A future release of Chrome will only deliver cookies with cross-site requests if they are 
set with `SameSite=None` and `Secure`. You can review cookies in developer tools under 
Application>Storage>Cookies and see more details at 
https://www.chromestatus.com/feature/5088147346030592 and 
https://www.chromestatus.com/feature/5633521622188032.

而这个错误

 Resource interpreted as Document but transferred with MIME type application/vnd.ms-excel: 
"http://local_ip:8083/api/getMailReport? reportType=MU&surId=SUR00002&selectedFromDate=05%2F11%2F2019&selectedToDate=11%2F11%2F2019&lang=E&gener 
ateReport=Generate+Report".

如何克服这个问题

4

1 回答 1

1

Chrome 将在 Chrome 80 中更改其行为以应用两个新规则:

  1. 没有属性的 CookieSameSite将被视为SameSite=Lax默认设置,即它们将仅是第一方或同一站点
  2. 供第三方或跨站点使用的 Cookie 必须标记为SameSite=None; Secure

控制台警告只是为了通知您,您需要根据您的站点需要的行为将相关属性添加到您的 cookie 中。

您可以查看https://web.dev/samesite-cookies-explainedhttps://web.dev/samesite-cookie-recipes了解更多信息。

于 2019-11-19T00:52:53.550 回答