code: public boolean cookiePresent(String expectedCookieName) {
          boolean isCookiePresent = false;
          try {
              if (driver.manage().getCookieNamed(expectedCookieName) != null) {
                  isCookiePresent = true;
              }
              return isCookiePresent;
          } catch (Exception e) {
              log.error(e);
              return false;
          }
      }
docs: Determines if a cookie exists in the application with the provided
  cookieName.
  
  @param expectedCookieName - the name of the cookie
  @return Boolean: if the cookie is present