Use the session to save the object for the next page load. // Create a new object $object = new stdClass(); $object->value = 'something'; $object->other_value = 'something else'; // Start the session session_start(); // Save the object in the user's session $_SESSION['object'] = $object; Then in the next page that loads from AJAX // Start the session saved from last time session_start(); // Get ..