Safari 6中未设置的Cookie [英] Cookies not setting in Safari 6

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

问题描述

晚上好,

我已经问过这个问题几次没有反应,希望这一次顺利。我已经开发Facebook应用程序了几年了,使用PHP和Facebook PHP SDK。最近我一直在努力与Safari和登录Facebook。

I've asked this question a couple of times without responses, hope this time goes well. I've been developing facebook apps for a couple of years now, using php and the Facebook PHP SDK. Lately I've been struggling with Safari and the login with Facebook.

问题是Safari 6默认选中阻止第三方Cookie选项,所以我的应用程序无法自动设置Cookie。我只能在Safari中看到这些Cookie,Cookie是空的,与Chrome或Firefox不同,两者都会保存Cookie。

The problem is that Safari 6 has checked by default the "Block 3rd party cookies" option, so my app can't set the cookies automatically. I'm seeing this only in Safari, the cookies are empty, unlike Chrome or Firefox, both are saving cookies well.

我使用< a href =https://github.com/facebook/facebook-php-sdk/blob/master/examples/example.php> Facebook PHP SDK示例,因此我不知道问题在哪里。我已经阅读了很多解决方案,但不是最新的,不适用于Safari 6.

I'm logging in the user with the Facebook PHP SDK example, so I don't know where the problem is. I've read a lot of "solutions" but are not up to date and don't work for Safari 6.

有一种方法来设置手动或手动告诉浏览器这是一个安全的网站吗?

我真的不知道我是否提出正确的问题。我非常希望这个问题,真的,我已经尝试了一切,我可以使用一些帮助,任何事情都会帮助。

I don't really know if I'm asking the right question. I'm desperate about this issue, really, I've tried everything and I could use some help, anything would help.

非常感谢!

推荐答案

您可以使用php手动设置cookie:

You can set the cookie manually with php:

setcookie(name, value, expire, path, domain);

http://php.net/manual/en/features.cookies.php

或者就是这样已经在使用?

Or is this what you are already using?

此外,请尝试使用p3p标头。

Also, try using p3p headers.

<?
  header('P3P: CP=HONK');
  setcookie('test_cookie', '1', 0, '/');
?>

这篇关于Safari 6中未设置的Cookie的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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