Fixed sending of headers when ajaxLogin is set

The status code is never sent to browser, so the response code is always 200.