cURL / Mailing Lists / curl-users / Single Mail

curl-users

curl and LTPA cookies

From: philippe vanderstraeten <phvander_at_gmail.com>
Date: Wed, 17 Dec 2014 13:58:47 +0100

Hello, I am trying to send request againts a web server.

I have used Fiddler & Firefox to have a trace of all URL traffic and I am
using this trace to do the same with Curl.

For the first URL call I should retrrieve JESSIONID & 2 cookies:
LtpaToken2
LtpaToken

But using curl I dont get those 2 cookies ?

I am using the following curls options and URL:

curl -c cookies.jar -b cookies.jar --insecure --max-redirs 10 -H
"Accept: text/html,application/xhtml+xml,application/xml;q=0.9,*/*;q=0.8"
-H "Accept-Language: en-US,en;q=0.5 -H Accept-Encoding: gzip, deflate"
--include -o STEP1_data.log --trace STEP1.log --trace-ascii
STEP1_dump.log -X GET http://myhost:10040/partner-portal-mock

Thanks for your help.

Bellow are some detailed infos

Here is what I got using Fiddler
==========================================================
GET http://myhost:10040/partner-portal-mock/ HTTP/1.1
Host: myhost:10040
User-Agent: Mozilla/5.0 (Windows NT 6.1; WOW64; rv:31.0) Gecko/20100101
Firefox/31.0
Accept: text/html,application/xhtml+xml,application/xml;q=0.9,*/*;q=0.8
Accept-Language: en-US,en;q=0.5
Accept-Encoding: gzip, deflate
Cookie: JSESSIONID=0000T5tVG-WUi6F3Pb99ScRVsjV:15cnpqqjv;
LtpaToken2=O2tRiAR4TpQgnKOuyhP1eSaGLFp2Arwc9RfXYGwDfpkWSfIVdcVigpn8mu1Qnd7mIBgXuBFoNkgI/aV6u+1S8fiuHgqK9n+wTugaNsXPNNq85ZogwETVkkudIqQ+EMj4/QGfBKcUEZtSPtLUPtHr1O/bHGvnK1Xxhl4WQxGx60OifiZRjlBhedk7dtI7SY9cvTn7o/KYjmzdQOVwFujP5N/SPS+n60c3eSRQVCrgWyYYrXPMkC5phTmxNlaI9ny7Umug4jL7K+K0bP9hRcN0hwH83UWS1tovodka78K2WK98+IYwk4hwbip7d2tperCPMyYPp38TZdFgAt9QEzIY3YuO2Y0mmtSII1mteamPPtOe8FMtUmSR5piYUCFA+yiIZw2j8AKb5eH5FUICMeZb9YUeCqcPCso7eKtIISRT9wRJBpplZK2Zs1uFhhmgpEyvXKpQ/senCTaTCglbwsYO6uzBct62pLadQpdlVeqefVq0LBaYwbBCHT2vvLuzhfGvoooPKWiBF8YtbjdkHGmB/0kP0IsXoAW2YCcfAXOwuizckPzFhiAbJDJx+XqEj8EX5LpbRG0VPgpAAC3Zbw7CkOta1o8AHWno8IsVbO7WI3RJcY+nN7mpk8TNPMjAT0DrItHyJyaojgBgURRmRFyaGYBCgZvbCi33IuEYSK5qrp1NLyToN7K4hMzF6c0QTkAm85/loKBExdVsZBLaJO3R72vjL0Iny/0C0uDZfAG8gKy5GUp8O02TxbLABXFp7zMh2pypHs0bUVth5BDeuvLjFd005AgH1vKdayBAFiQnwiQMykSOqQkeNX2Xo90XlyIX;
LtpaToken=EJMO9masGUlbViAkeUQ8q047LlCUvqoqa3V6lSwgOqD999sEUc1eDnursBdwqDtfyqyxbXaJSx7oNc8xPdBqCSpQ6KB/cQBaSZI0qgmwEgkVx7Wwblu/lR5FVbR0PEtCDf1MAtIzSInkexJwYPlUwdz6DqYRxPqmzi7/65cy33i/8HBxwoOdlyhicxq1IjYcoLYwfup6Nq90R2gUKJ9L89Ej5dGjkgmpRuWB52rlZlo9fTme3SeyYg7LszZZB5UAzzxQ7K0w49D38BtkotXTs5vGHZuzzdF615/acHyUSSJQI6ZkZ/hyCJgFCBsy2u+5NoRYdhG8UP+2O4kR3dzXGsqMGpnQLwxHUm9c8uUp4HtXr0XPz8CAfxoLCgyHkLiZxuMzwgO0vcE=
Connection: keep-alive

Here is what I get in STEP1.log (curl trace)
==========================================================
== Info: About to connect() to myhost port 10040
== Info: Trying w.x.y.z... == Info: connected
== Info: Connected to myhost (w.x.y.z) port 10040
=> Send header, 180 bytes (0xb4)
0000: 47 45 54 20 2f 70 61 72 74 6e 65 72 2d 70 6f 72 GET /partner-por
0010: 74 61 6c 2d 6d 6f 63 6b 2f 20 48 54 54 50 2f 31 tal-mock/ HTTP/1
0020: 2e 31 0d 0a 55 73 65 72 2d 41 67 65 6e 74 3a 20 .1..User-Agent:
0030: 63 75 72 6c 2f 37 2e 31 35 2e 35 20 28 69 33 38 curl/7.15.5 (i38
0040: 36 2d 72 65 64 68 61 74 2d 6c 69 6e 75 78 2d 67 6-redhat-linux-g
0050: 6e 75 29 20 6c 69 62 63 75 72 6c 2f 37 2e 31 35 nu) libcurl/7.15
0060: 2e 35 20 4f 70 65 6e 53 53 4c 2f 30 2e 39 2e 38 .5 OpenSSL/0.9.8
0070: 62 20 7a 6c 69 62 2f 31 2e 32 2e 33 20 6c 69 62 b zlib/1.2.3 lib
0080: 69 64 6e 2f 30 2e 36 2e 35 0d 0a 48 6f 73 74 3a idn/0.6.5..Host:
0090: 20 50 4e 31 50 30 31 44 45 56 4d 30 31 3a 31 30 myhost:10
00a0: 30 34 30 0d 0a 41 63 63 65 70 74 3a 20 2a 2f 2a 040..Accept: */*
00b0: 0d 0a 0d 0a ....
<= Recv header, 17 bytes (0x11)
0000: 48 54 54 50 2f 31 2e 31 20 32 30 30 20 4f 4b 0d HTTP/1.1 200 OK.
0010: 0a .
<= Recv header, 40 bytes (0x28)
0000: 43 6f 6e 74 65 6e 74 2d 54 79 70 65 3a 20 74 65 Content-Type: te
0010: 78 74 2f 68 74 6d 6c 3b 20 63 68 61 72 73 65 74 xt/html; charset
0020: 3d 55 54 46 2d 38 0d 0a =UTF-8..
<= Recv header, 25 bytes (0x19)
0000: 43 6f 6e 74 65 6e 74 2d 4c 61 6e 67 75 61 67 65 Content-Language
0010: 3a 20 65 6e 2d 55 53 0d 0a : en-US..
<= Recv header, 22 bytes (0x16)
0000: 43 6f 6e 74 65 6e 74 2d 4c 65 6e 67 74 68 3a 20 Content-Length:
0010: 32 34 35 31 0d 0a 2451..
== Info: Added cookie JSESSIONID="0000SthH9O-38nDEiweSPk9aTF5:15cnpqqjv"
for domain myhost, path /, expire 0
<= Recv header, 70 bytes (0x46)
0000: 53 65 74 2d 43 6f 6f 6b 69 65 3a 20 4a 53 45 53 Set-Cookie: JSES
0010: 53 49 4f 4e 49 44 3d 30 30 30 30 53 74 68 48 39 SIONID=0000SthH9
0020: 4f 2d 33 38 6e 44 45 69 77 65 53 50 6b 39 61 54 O-38nDEiweSPk9aT
0030: 46 35 3a 31 35 63 6e 70 71 71 6a 76 3b 20 50 61 F5:15cnpqqjv; Pa
0040: 74 68 3d 2f 0d 0a th=/..
<= Recv header, 37 bytes (0x25)
0000: 44 61 74 65 3a 20 57 65 64 2c 20 31 37 20 44 65 Date: Wed, 17 De
0010: 63 20 32 30 31 34 20 30 39 3a 33 33 3a 31 30 20 c 2014 09:33:10
0020: 47 4d 54 0d 0a GMT..
<= Recv header, 42 bytes (0x2a)
0000: 53 65 72 76 65 72 3a 20 57 65 62 53 70 68 65 72 Server: WebSpher
0010: 65 20 41 70 70 6c 69 63 61 74 69 6f 6e 20 53 65 e Application Se
0020: 72 76 65 72 2f 36 2e 31 0d 0a rver/6.1..
<= Recv header, 40 bytes (0x28)
0000: 45 78 70 69 72 65 73 3a 20 54 68 75 2c 20 30 31 Expires: Thu, 01
0010: 20 44 65 63 20 31 39 39 34 20 31 36 3a 30 30 3a Dec 1994 16:00:
0020: 30 30 20 47 4d 54 0d 0a 00 GMT..
<= Recv header, 51 bytes (0x33)
0000: 43 61 63 68 65 2d 43 6f 6e 74 72 6f 6c 3a 20 6e Cache-Control: n
0010: 6f 2d 63 61 63 68 65 3d 22 73 65 74 2d 63 6f 6f o-cache="set-coo
0020: 6b 69 65 2c 20 73 65 74 2d 63 6f 6f 6b 69 65 32 kie, set-cookie2
0030: 22 0d 0a "..
<= Recv data, 1102 bytes (0x44e)
0000: 3c 21 44 4f 43 54 59 50 45 20 48 54 4d 4c 20 50 <!DOCTYPE HTML P

-------------------------------------------------------------------
List admin: http://cool.haxx.se/list/listinfo/curl-users
FAQ: http://curl.haxx.se/docs/faq.html
Etiquette: http://curl.haxx.se/mail/etiquette.html
Received on 2014-12-17