private static List<Cookie> getCookies(HttpServletRequest request) {

        Cookie[] cookies = request.getCookies();
        if (cookies == null || cookies.length == 0)
            return Collections.emptyList();

        return Collections.unmodifiableList(Arrays.asList(cookies));

    }
Returns an unmodifiable List of all cookies in the given HTTP request.

@param request
    The HTTP request to extract all cookies from.

@return
    An unmodifiable List of all cookies in the given request.
guacamole-ext/src/main/java/org/apache/guacamole/net/RequestDetails.java