code: public void cookieExists(double seconds, String expectedCookieName) {
          double end = System.currentTimeMillis() + (seconds * 1000);
          while (!app.is().cookiePresent(expectedCookieName) && System.currentTimeMillis() < end) ;
          double timeTook = Math.min((seconds * 1000) - (end - System.currentTimeMillis()), seconds * 1000) / 1000;
          checkCookieExists(expectedCookieName, seconds, timeTook);
      }
docs: Waits up to the provided wait time for a cookie exists in the application with the provided
  cookieName. This information will be logged and recorded, with a
  screenshot for traceability and added debugging support.
  
  @param expectedCookieName the name of the cookie
  @param seconds            the number of seconds to wait