Added CURL timeout.
Added logging.
Fixed cookie domain error.