code: public Cookie getCookieObject(String name) {
  		Cookie[] cookies = request.getCookies();
  		if (cookies != null)
  			for (Cookie cookie : cookies)
  				if (cookie.getName().equals(name))
  					return cookie;
  		return null;
  	}
docs: Get cookie object by cookie name.