hasCookie method added.