Take the 2-minute tour ×  I am doing a simple ajax request to
another domain like this:  <script type="text/javascript">
$(function() {     $('.clik').click(function() {
type: "POST",               url:
"http://sub.mydomain.com/test.php",               crossDomain:
true,               success: function(data) {     <p
class="clik">Halleluja</p> <p class="txt"></p>  this is the
test.php page on sub.mydomain.com  header('Access-Control-Allow-
Origin: http://mydomain.com'); // Begin Session $session = new
Session(); $session->start_session('test', false);  // Access
Database $login_db = new Database('user', 'pass', 'accounts',
'test'); $login_pdo = $login_db->PDO;  include
"fn.check_login.php"; if(checkLogin($login_pdo) == true) {
// We start out by checking if the request has been made using
AJAX     if (is_ajax()) {          echo "this is working";
} else {          echo "this is not working!";   } else {
echo 'You are not authorized to access this page, please login.
<br/>';  // Funct