private static String toSetCookie(ResponseCookie resCookie) {
        final CookieBuilder builder = Cookie.builder(resCookie.getName(), resCookie.getValue());
        if (!resCookie.getMaxAge().isNegative()) {
            builder.maxAge(resCookie.getMaxAge().getSeconds());
        }
        if (resCookie.getDomain() != null) {
            builder.domain(resCookie.getDomain());
        }
        if (resCookie.getPath() != null) {
            builder.path(resCookie.getPath());
        }
        builder.secure(resCookie.isSecure());
        builder.httpOnly(resCookie.isHttpOnly());
        if (resCookie.getSameSite() != null) {
            builder.sameSite(resCookie.getSameSite());
        }
        final Cookie cookie = builder.build();
        return cookie.toSetCookieHeader(false);
    }
Converts the specified {@link ResponseCookie} to Netty's {@link Cookie} interface.
spring/boot3-webflux-autoconfigure/src/main/java/com/linecorp/armeria/spring/web/reactive/ArmeriaServerHttpResponse.java