code: protected String getJWTFromCookie(HttpServletRequest req) {
          String serializedJWT = null;
          Cookie[] cookies = req.getCookies();
          if (cookieName != null && cookies != null) {
              for (Cookie cookie : cookies) {
                  if (cookieName.equals(cookie.getName())) {
                      if (LOG.isDebugEnabled()) {
                          LOG.debug("{} cookie has been found and is being processed", cookieName);
                      }
                      serializedJWT = cookie.getValue();
                      break;
                  }
              }
          }
          return serializedJWT;
      }
docs: Encapsulate the acquisition of the JWT token from HTTP cookies within the
  request.
  
  @param req servlet request to get the JWT token from
  @return serialized JWT token