I'm using a bookmarklet to post content to a new page on a separate domain. When I set a session variable, like
session_start();
$_SESSION["iamset"] = "true";
on a page, say http://www.mydomain.com/settrue.php, and I echo the result on http://www.mydomain.com/amiset.php like so:
session_start();
echo $_SESSION["iamset"];
when I visit that page in a browser, I can verify that $_SESSION["iamset"]
is indeed "true". But when I make an AJAX request to it from a separate page that isn't on the domain, $_SESSION["iamset"]
is not "true". What is it about the AJAX request that makes it fail? I read somewhere that AJAX requests are exactly the same as HTTP requests, so I figure it's an issue with the cross-domain access. My PHP does have the header:
header("Access-Control-Allow-Origin: *");
Thanks!