Q: Why is my PHP $_SESSION cleared when doing an AJAX Post? I'm trying to get some values from my $_SESSION variable but it seems to be cleared everytime an AJAX request is initiated. 
I have pasted the code below, any help much appreciated :
/*
 * The input request from angularjs
 */
$data = file_get_contents("php://input");
$data = json_decode($data, true);

switch( strtolower($data['action']) ) {
  case 'products': getAllProducts($data['fields']);
    break;
  default : echo json_encode(array('success' => false)); 
}
//fb is a firebug debug function, prints PHP vars to console.
fb($_SESSION['var'); //when loading the php file the first time $_SESSION is set

UPDATE
I'm using AngularJS for my AJAX calls, it works great but now I want to read data from my $_SESSION variable and all I get is an empty $_SESSION. Does this have anything to do with my file_get_contents("php://input"); 
SOLVED
I found the problem, the previous developer did not take into account that one might desire to include files from 2 levels deep :) As such, I scanned through the PHP error logs and saw that a previous script was not loading - this particular script was included with the session_start and $_SESSION variable values.
Checking the error logs will be my first priority from now on

A: I found the problem, the previous developer did not take into account that one might desire to include files from 2 levels deep :) As such, I scanned through the PHP error logs and saw that a previous script was not loading - this particular script was included with the session_start and $_SESSION variable values. Checking the error logs will be my first priority from now on
