How reliable is a method of setting variables into a session and then retrieving them on another page?
I have a script where users drag and drop elements on a page utilizing jQuery UI. I record transactions using AJAX, however, sometimes I get results missing project ID, or to be exact I get 0. I set this ID into a session variable when users first get on this script page. The page has an included JS file with my functions and from there the transaction data is sent to an AJAX page where I store transactions into my db. Because the project ID is the same I get it from my session. It is not a consistent error, happens only once in a while, but it bothers me a lot.
Why is it happening randomly? And how can I fool-proof my code?
UPDATE: OK, it seems it's something else that may be interfearing with that particular session ID.
I do have session_start();
on every page where I use sessions and I set them the same way I set all my sessions: `$_SESSION['project'] = $projectID;
Back to debugging...