且构网

分享程序员开发的那些事...
且构网 - 分享程序员编程开发的那些事

在 Safari 中设置跨域 cookie

更新时间:2022-04-15 23:21:02

来自 Safari 开发者常见问题解答:

Safari 附带了一个保守的 cookie 策略,该策略将 cookie 写入仅限于用户选择(导航到")的页面.此默认保守策略可能会混淆尝试写入 cookie 并失败的基于框架的站点.

Safari ships with a conservative cookie policy which limits cookie writes to only the pages chosen ("navigated to") by the user. This default conservative policy may confuse frame based sites that attempt to write cookies and fail.

我找不到解决这个问题的方法.

I have found no way to get around this.

如果值得的话,如果您使用 <script> 附加方法,Chrome 也不会设置 cookie,但是如果您有隐藏的 <img> 使用相同的来源,Chrome 可以与其他浏览器一起使用(Safari 除外)

If it's worth anything, Chrome doesn't set the cookies either if you use the <script> appending method, but if you have a hidden <img> with the same source, Chrome works in addition to the rest of the browsers (except, again, Safari)