logout function should return the XMLHTTPRequest