curl cookie jar 文件值

curl cookie jar file value

curl -c 文件的输出如下所示

#HttpOnly_.mysite.net TRUE / TRUE 0 mywebsessionid 000000-90ae-4ba5-b5be-4d10be6be098

#HttpOnly_.mysite.net TRUE / TRUE 0 mysitepkey 0000_gv-X8nOvg9KgMLNWA==

因为两个值都为真,所以我在手动编辑时得到 "unauthorized" "TRUE /FALSE" 我得到 200。可能是 TRUE/TRUE.[=15= 的原因]

第一个=命令

 curl -c cookie.txt -d "username=user" -d "password=pass" https://www.example.com/login

第二=命令

 curl -b cookie.txt -v -X GET http://mysite/data/myfile/view -H "Content-type: application/json"

http 头输出

               > "Content-type: application/json"
               *   Trying 168.14.61.148...
               * Connected to login.mysite.come (168.14.61.148) port 8080                (#0)
             > GET /login.mysite.com HTTP/1.1
             > User-Agent: curl/7.40.0
              > Host: mysite.com:8080
             > Accept: */*
             > Cookie: mykey=ehhf3GYqNbIz5rMixfT1Pg22;
              > X-MYSITE-SESSION:323158ce-da52-41b8-9c66-a897fcb22222;
              > Content-type: application/json
               >
              < HTTP/1.1 200 OK
               < Cache-Control: no-cache, no-store, must-revalidate
              < Content-Type: application/xml
              < Date: Sun, 27 Sep 2015 22:05:25 GMT
              < Expires: 0
               < Pragma: no-cache
              < Server: Apache-Coyote/1.1
             < Vary: Accept-Encoding
             < transfer-encoding: chunked
              < Connection: keep-alive

第一个TRUE,在第二列是"tailmatch"是或否。

第四列中的第二个 TRUE 是 "secure" cookie 是或否。安全 cookie 仅通过 HTTPS 发送。