Server side:
....
$_SESSION[\'accountId\'] = $accountId;
$_SESSION[\'type\'] = $_POST[\'accountType\'];
echo \'1\';
return;
<
Try omitting the return statement from server-side code. As far as your error callback is concerned, use the following generic ajax callback code and let us know what the status, responseText, and statusText properties are when this fails:
function callback(response)
{
if (response.readyState == 4)
{
if (response.status == 200)
{
alert("Response Success:\n" + response.responseText);
}
else
{
alert("Response Error:\n" + response.statusText);
}
}
}