restored the json error for login, solved weird cookie problem