I guess one way of doing it is to have a script on another domain (not a subdomain, according to definition but I haven't tested this) that simply sets a cookie, and then the script can return JSONP so you can use it with javascript on another domain. So something like:
PHP ( cookie.php )
<?php
header("Content-type: application/javascript");
header("Cache-Control: no-store, no-cache, must-revalidate, max-age=0");
header("Cache-Control: post-check=0, pre-check=0", false);
header("Pragma: no-cache");
if(isset($_GET["set"])){ //first run here
setcookie("cookie_test","cookies",time()+3600);
//redirect to self after setting cookie so we don't have to call script twice
header('Location: cookies.php?&callback='.@$_GET["callback"]);
die(); //death
}
//once redirected should go here
$cookie_set=array("cookies"=>isset($_COOKIE["cookie_test"]));
echo @$_GET["callback"]. "(" . json_encode($cookie_set) . ")";
Javascript/Jquery
//callback=? for jquery to know it's jsonp. &set so the script sets first
$.getJSON("http://another.domain.com/cookies.php?callback=?&set")
.done(function(data){
if(data.cookies){
//third party cookies are enabled
} else {
//third party cookies probably disabled
}
})
Demo. Tested it out on Safari on Mac.