Server side:
.... $_SESSION[\'accountId\'] = $accountId; $_SESSION[\'type\'] = $_POST[\'accountType\']; echo \'1\'; return;
1) go to the url in your browser (the one you're fetching with ajax)
2) set the error callback for the jquery ajax request.