code: public static String extractCookie(final HttpServletRequest request, final String name) {
  		for (Cookie cookie : request.getCookies()) {
  			if (cookie.getName().equals(name)) {
  				return cookie.getValue();
  			}
  		}
  		return null;
  	}
docs: Find the value of a cookie on the request, by name.
  @param request The request on which to check for the cookie.
  @param name The name of the cookie we want the value of.
  @return The value of the cookie, if present, otherwise null.