I have to call domain A.com (which sets the cookies with http) from domain B.com. All I do on domain B.com is (javascript):
var head = document.getElementsByTagName("head")[0]; var script = document.createElement("script"); script.src = "A.com/setCookie?cache=1231213123"; head.appendChild(script);
This sets the cookie on A.com on every browser I've tested, except Safari. Amazingly this works in IE6, even without the P3P headers.
Is there any way to make this work in Safari?
Open the Safari browser. From the menu bar, go to Safari > Preferences. In the preferences dialog, go to the Privacy tab and disable the Prevent cross-site tracking permission.
There's no such thing as cross domain cookies. You could share a cookie between foo.example.com and bar.example.com but never between example.com and example2.com and that's for security reasons.
You can stop third-party content providers from tracking you across websites to advertise products and services. In the Safari app on your Mac, choose Safari > Preferences, then click Privacy. Select “Prevent cross-site tracking.”
From the Safari Developer FAQ
:
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.
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)
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With