class Http {

    static String getCookieValue(HttpServletRequest hreq, String name) {
        
        javax.servlet.http.Cookie[] cookies = hreq.getCookies();
        if (cookies == null) {
            return null;
        }
        for (javax.servlet.http.Cookie cookie : cookies) {
            if (name.equals(cookie.getName())) {
                return cookie.getValue();
            }
        }
        return null;
    }

}