I'm using AJAX to submit POST data to a parser file
$.ajax({
type: 'POST',
url: '<?php echo AJAX_DIR; ?>/parser.php',
data: data,
etc......
On the submitting page, I can echo/use $user->data()->id; just fine. If I browse to the parser file directly I can also echo/use $user->data()->id; just fine. However, when I submit the AJAX, the $user object is empty.
I've also tried using a $_SESSION variable to get my data to the AJAX parser and the same behavior is present (good on the page and parser file when I browse to it, but empty upon AJAX submission).
Any ideas?
EDIT for showing the first few lines of the parser file...
<?php
//For allowing this to be accessed from anywhere within users.mysite.com
header('Access-Control-Allow-Origin: https://users.mysite.com');
//Userspice requires
require_once '../../init.php';
Note: The init.php file starts the session as the first thing.