用会话cookie进行bash curl?

用会话cookie进行bash curl?,bash,curl,cookies,session-cookies,Bash,Curl,Cookies,Session Cookies,我通过手动从firefox中提取cookie并在curl命令中使用,获得了一个使用site minder身份验证的网页的curl输出: curl "example.com/firstexample" -H "Host: example.com" -H "User-Agent: Mozilla/5.0 (Windows NT 6.1; WOW64; rv:50.0) Gecko/20100101 Firefox/50.0" -H "Accept: text/html,application/xht

我通过手动从firefox中提取cookie并在curl命令中使用,获得了一个使用site minder身份验证的网页的curl输出:

curl "example.com/firstexample" -H "Host: example.com" -H "User-Agent: Mozilla/5.0 (Windows NT 6.1; WOW64; rv:50.0) Gecko/20100101 Firefox/50.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 "Content-Type: application/x-www-form-urlencoded" -H "X-Requested-With: XMLHttpRequest" -H "Referer: http://example.com" -H --cookie-jar cookies.txt --cookie cookies.txt -H "Connection: keep-alive"
但是,curl仅在会话持续时有效。一旦一个新会话开始,即cookie会话id和其他内容发生变化,curl就不再有效

是否有办法通过curl获得后续cookie/会话ID,以便继续无seemless。

查看手册页中
-cookie
-cookie jar
选项。他们应该做你需要的事