curl / Mailing Lists / curl-users / Single Mail

curl-users

Re: Cookies from curl cmd not matching cookies from browser

From: Jeremy Nicoll <jn.ml.crlu.36_at_letterboxes.org>
Date: Mon, 16 Jul 2018 12:00:32 +0100

On Sat, 14 Jul 2018, at 19:30, bruce wrote:

> I then copy the "cURL" cmd from the firebug dialog, which results in:
> curl 'https://smccis.smc.edu/smcweb/f?p=118:1:1099677479717' -H 'Host:
> smccis.smc.edu' -H 'User-Agent: Mozilla/5.0 (X11; Linux x86_64;
> rv:52.0) Gecko/20100101 Firefox/52.0' -H 'Accept:
> text/html,application/xhtml+xml,application/xml;q=0.9,*/*;q=0.8' -H
> 'Accept-Language: en-US,en;q=0.5' --compressed -H 'Cookie:
> ORA_WWV_APP_118=ORA_WWV-jMu08G5jY_5pTpZnTfWHF7RX;
> ORA_WWV_USER_61917392119870=ORA_WWV-IAmUD0LPRXrHnrE6LuZj7pJM;
> _ga=GA1.2.1168176653.1531572004; _gid=GA1.2.232116952.1531572004' -H
> 'Connection: keep-alive' -H 'Upgrade-Insecure-Requests: 1'

So that supplies cookie data within the command line... but doesn't save
revised/new cookies anywhere...

whereas this:

> curl -L 'https://smccis.smc.edu/smcweb/f?p=118:1:1099677479717' -H
> 'Host: smccis.smc.edu' -H 'User-Agent: Mozilla/5.0 (X11; Linux x86_64;
> rv:52.0) Gecko/20100101 Firefox/52.0' -H 'Accept:
> text/html,application/xhtml+xml,application/xml;q=0.9,*/*;q=0.8' -H
> 'Accept-Language: en-US,en;q=0.5' --compressed --cookie-jar a.lwp
> --cookie a.lwp -H 'Connection: keep-alive' -H
> 'Upgrade-Insecure-Requests: 1'

reads cookies from a file then writes revised/new ones to that
same file.

On the rare occasions I've experimented with something like this I
always used different files for supplying cookies to a curl command
and collected the resulting cookies, so I could rerun any particular
stage (of a series of curl commands) with the right input cookies. I
don't know if your use of the same file might have confused things.

-- 
Jeremy Nicoll - my opinions are my own.
-----------------------------------------------------------
Unsubscribe: https://cool.haxx.se/list/listinfo/curl-users
Etiquette:   https://curl.haxx.se/mail/etiquette.html
Received on 2018-07-16