Server side:
.... $_SESSION[\'accountId\'] = $accountId; $_SESSION[\'type\'] = $_POST[\'accountType\']; echo \'1\'; return;
in your php code, use json_encode to return the response
eg:
$response = array('success'=>1); echo json_encode($response);
then in your ajax success function it should be
if (response.success == 1) { alert('success'); }