c.setVersion(version); c.setMaxAge(maxAge); c.setPath(path);
@Override public NettyHttpResponse cookie(HttpCookie httpCookie) { Cookie nettyCookie = new DefaultCookie(httpCookie.getName(),httpCookie.getValue()); nettyCookie.setDomain(httpCookie.getDomain()); nettyCookie.setPath(httpCookie.getPath()); nettyCookie.setSecure(httpCookie.getSecure()); nettyCookie.setMaxAge((int)httpCookie.getMaxAge()); nettyCookie.setVersion(httpCookie.getVersion()); nettyCookie.setDiscard(httpCookie.getDiscard()); nettyCookie.setHttpOnly(true); CookieEncoder encoder = new CookieEncoder(true); encoder.addCookie(nettyCookie); return header(HttpHeaders.Names.SET_COOKIE, encoder.encode()); }
@Override public NettyHttpResponse cookie(HttpCookie httpCookie) { Cookie nettyCookie = new DefaultCookie(httpCookie.getName(),httpCookie.getValue()); nettyCookie.setDomain(httpCookie.getDomain()); nettyCookie.setPath(httpCookie.getPath()); nettyCookie.setSecure(httpCookie.getSecure()); nettyCookie.setMaxAge((int)httpCookie.getMaxAge()); nettyCookie.setVersion(httpCookie.getVersion()); nettyCookie.setDiscard(httpCookie.getDiscard()); nettyCookie.setHttpOnly(true); CookieEncoder encoder = new CookieEncoder(true); encoder.addCookie(nettyCookie); return header(HttpHeaders.Names.SET_COOKIE, encoder.encode()); }