Cookies not setting in Safari 6

时间秒杀一切 提交于 2019-12-21 11:08:33

问题


Good evening,

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.

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.

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.

Is there a way to set the cookies manually or a trick to tell the browser that this is a secure site?

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.

Thank you very much!


回答1:


have you tried any of these Setting cross-domain cookies in Safari

Safari6 out of box, doesn't allow cross domain cookies which is the problem.




回答2:


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?

Also, try using p3p headers.

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



回答3:


Have you tried PHP sessions? If I remember correctly, you can set session.use_only_cookies to 0 so that the IDs are passed using SID.




回答4:


Have you tried the solution specified in this blog with a heading update 2.

http://www.reizbombardement.de/archives/safari-5-1-4-enforces-cookie-policy

I expect it works here.



来源:https://stackoverflow.com/questions/14825805/cookies-not-setting-in-safari-6

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!