Fixed getCookie bug when there is no cookie.