Unix cUrl cookie login to a .jsp servlet page, request and save file requested
<p>I have tried to export a text file resulted by an request to a .jsp page with Java script enabled from Oracle BI Publisher framework with below command in Unix:</p>

<pre><code>curl 'http://server/xmlpserver/report.xdo&amp;_xt=New+Template+1&amp;_xf=text'
-H 'Accept-Encoding: gzip, deflate, sdch' -H 'Accept-Language: en-US,en;q=0.8'
-H 'Upgrade-Insecure-Requests: 1' -H 'User-Agent: Mozilla/5.0 (Windows NT 6.1) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/53.0.2785.116 Safari/537.36'
-H 'Accept: text/html,application/xhtml+xml,application/xml;q=0.9,image/webp,*/*;q=0.8'
-H 'Referer: http://server/xmlpserver/report.xdo'
-H 'Cookie: 
JSESSIONID=qq!11!22; ORA_XDO_UI=en_US; 
JSESSIONID=qq!11; oracle.uix=0^^GMT+3:00^p' 
-H 'Connection: keep-alive'
--compressed -o test.txt
</code></pre>

<p>This command is 'copy as bash curl command' from Google Chrome debugger and work it but syntax command use id JSESSION in cookie who will expire.</p>

<p>I need to login on this .jsp page to generate cookie with JSESSION=qq!11!22 and JSESSION=qq!11 (see above cUrl syntax from Google Chrome).</p>

<p>For this I have used command:
curl -c cookies.txt -d "user=user&amp;pass=pass" <a href="http://server/xmlpserver/login.jsp" rel="nofollow">http://server/xmlpserver/login.jsp</a>, and was generated only one "JSESSIONID=qq!11;".</p>

<p>I need to generate one more JSESSIONID=qq!11!22.</p>

<p>Thanks!</p>