code: public Cookie cookie(String expectedCookieName) {
          try {
              return driver.manage().getCookieNamed(expectedCookieName);
          } catch (Exception e) {
              log.warn(e);
              return null;
          }
      }
docs: Retrieves the full cookie in the application with the provided
  cookieName. If the cookie doesn't exist, a null value will be returned.
  
  @param expectedCookieName - the name of the cookie
  @return Cookie - the cookie