cURL / Mailing Lists / curl-library / Single Mail

curl-library

CURLOPT_COOKIEJAR not working from Java?!?

From: Serge Kruppa <serge_at_portaldevoz.net>
Date: Wed, 13 Mar 2002 01:18:43 -0600

Hello Again,

I'm trying to get a session ID cookie stored in a file by using
CURLOPT_COOKIEJAR (code 10082) from a Java program that invokes libcurl (see
below). I can see from the verbose output that the cookie is accepted (i.e.
I see "Cookie: sesessionid=5JS4NP3MRCDGMIIDBLQU2UA" on the console) but no
cookie.txt file gets created. What am I doing wrong?

Best Regards,

Serge

+++

    public static void main(String[] args)
    {
                CurlGlue cg;

        try {
                cg = new CurlGlue();
                        test cw = new test();
                        cg.setopt(CurlGlue.CURLOPT_URL, "removed");
                        cg.setopt(CurlGlue.CURLOPT_SSLVERSION, 3);
                        cg.setopt(CurlGlue.CURLOPT_VERBOSE, 1);
                        cg.setopt(CurlGlue.CURLOPT_FOLLOWLOCATION, 1);
                        cg.setopt(CurlGlue.CURLOPT_POST, 1);
                        cg.setopt(10082, "cookie.txt");
                        cg.setopt(CurlGlue.CURLOPT_POSTFIELDS, "removed");
                        cg.setopt(CurlGlue.CURLOPT_WRITEFUNCTION, cw);
                        cg.perform();
                } catch (Exception e) {
                       e.printStackTrace();
                }

    }
Received on 2002-03-13