import java.net.HttpCookie;
import java.util.List;

public class Test {

    public static void main(String[] args) {
        String cookieHeader = "Set-Cookie: name=value; expires=Thu, 01 Jan 2026 00:00:00 GMT; max-age=360000";

        try {
            List<HttpCookie> cookies = HttpCookie.parse(cookieHeader);

            for (HttpCookie cookie : cookies) {

                System.out.println("Cookie Name: " + cookie.getName());
                System.out.println("Cookie Value: " + cookie.getValue());
                System.out.println("Cookie Version: " + cookie.getVersion());
                System.out.println("Cookie Max-Age: " + cookie.getMaxAge());
                System.out.println("--------------------");
            }
        } catch (IllegalArgumentException e) {
            System.err.println("Error parsing cookie string: " + e.getMessage());
        }
    }
}