Safari无法获得HEROKU的Cookie [英] Safari can't get HEROKU's cookie

查看:84
本文介绍了Safari无法获得HEROKU的Cookie的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

很抱歉,我无法提供太多信息,因为我完全不知道这个奇怪的问题.

I am sorry that I am not able to provide much info because I totally have no idea about this weird problem.

我有一个由Rails 3.2.2编写的fb canvas应用程序.

I have a fb canvas app which is written by rails 3.2.2 .

我的本​​地计算机(Mac OS X 10.7.4)上没有任何问题.

There is not any problem on my local machine (Mac OS X 10.7.4).

当我将其部署到heroku时,可以使用chrome和Firefox.但是,当我使用Safari浏览它时,Safari无法从heroku获取任何cookie. (它在开发人员工具中显示此网站没有cookie",但在我的本地计算机上运行良好.)

When I deploy it to heroku, it is fine with chrome and firefox. However, when I use Safari to browse it, Safari can't get any cookie from heroku. (it shows "This site has no cookies" in developer tool, but it works well on my local machine.)

我已经搜索了这个问题,并且得到了类似 this ,但我不知道认为这是我的情况.

I have googled this problem, and I get something like this and this, but I don't think these are the case of mine.

有什么建议吗?

如果您需要有关我的代码的任何特定信息来解决此问题,请告诉我.

If you need any specific info about my code to solve this problem, please let me know.

我将非常感谢!

推荐答案

我终于发现这是野生动物园安全设置的问题.

I finally found out that it's a problem of safari's security setting.

当fb画布通过iframe获取heroku的内容时,可能存在安全问题.如果我们将safari隐私设置的阻止cookie"从从第三方和广告商"(默认)降级为从不",则一切正常!

As fb canvas gets heroku's content through iframe, there may be security issues. If we donwgrade the 'Block cookies' of safari's privacy settings from 'From third parties and advertisers'(default) to 'Never', everything works well!

但是,我认为要求用户降级其安全设置不是一个好主意.我想知道是否有解决方案可以避免在野生动物园中出现这种限制.

However, I don't think asking users to downgrade their security settings is a good idea. I am wondering whether there is a solution to avoid this restriction in safari.

如果您有任何想法,请告诉我.非常感谢:)

please let me know if you have any idea. many thanks :)

这篇关于Safari无法获得HEROKU的Cookie的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆