code: public static void setRawCookie(String name, String value, HttpServletRequest req,
  			HttpServletResponse res, boolean httpOnly, int maxAge) {
  		if (StringUtils.isBlank(name) || value == null || req == null || res == null) {
  			return;
  		}
  		Cookie cookie = new Cookie(name, value);
  		cookie.setHttpOnly(httpOnly);
  		cookie.setMaxAge(maxAge < 0 ? Config.SESSION_TIMEOUT_SEC : maxAge);
  		cookie.setPath("/");
  		cookie.setSecure(req.isSecure());
  		res.addCookie(cookie);
  	}
docs: Sets a cookie.
  @param name the name
  @param value the value
  @param req HTTP request
  @param res HTTP response
  @param httpOnly HTTP only flag
  @param maxAge max age