Adding cookie and clearCookie method