首页
学习
活动
专区
圈层
工具
发布
社区首页 >问答首页 >在没有“`SameSite`”属性的情况下,设置了与http://local ip/的跨站点资源关联的cookie

在没有“`SameSite`”属性的情况下,设置了与http://local ip/的跨站点资源关联的cookie
EN

Stack Overflow用户
提问于 2019-11-18 06:48:48
回答 1查看 2.9K关注 0票数 1

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

代码语言:javascript
复制
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.

与此错误

代码语言:javascript
复制
 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".

如何克服这个问题

EN

回答 1

Stack Overflow用户

回答已采纳

发布于 2019-11-19 00:52:53

Chrome将改变其在Chrome 80中的行为,以适用两条新规则:

在默认情况下,没有SameSite=None; Secure.属性的

  1. Cookies将被视为SameSite=Lax,也就是说,它们将是只用于第三方或跨站点使用的
  2. Cookies,它们必须标记为SameSite=Lax

控制台警告只是通知您,您将需要添加相关属性到您的cookie取决于您的网站需要什么样的行为。

有关更多信息,您可以看到https://web.dev/samesite-cookies-explainedhttps://web.dev/samesite-cookie-recipes

票数 1
EN
页面原文内容由Stack Overflow提供。腾讯云小微IT领域专用引擎提供翻译支持
原文链接:

https://stackoverflow.com/questions/58909271

复制
相关文章

相似问题

领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档