Forum Bugs

cookiejar does not work after upgrading from prince 6 to prince 9

pkmiec
Hi,

We upgraded from Prince 6 rev 8 to Prince 9. It seems Prince 9 can no longer use the cookiejar file option.

The following is the command line,

/usr/bin/prince --baseurl http://10.0.1.239:8080/ --cookiejar=/usr/ci/TeamCity/buildAgent/work/f1aeee5f7794b891/tmp/tmp/ci3_16324_1389405097_77601.txt --media=print --no-xinclude --ssl-blindly-trust-server --no-system-fonts --style /usr/ci/TeamCity/buildAgent/work/f1aeee5f7794b891/vendor/bundle/ruby/2.0.0/gems/pdf_rendering-4.22.0/lib/pdf_rendering/fonts.css --style /usr/ci/TeamCity/buildAgent/work/f1aeee5f7794b891/public/assets/application2.css --no-embed-fonts /usr/ci/TeamCity/buildAgent/work/f1aeee5f7794b891/tmp/tmp/ci3_16324_1389405097_77600.html --output /usr/ci/TeamCity/buildAgent/work/f1aeee5f7794b891/shared_tmp/files/ci3_16324_1389405097_77602.pdf


The cookiejar file contains,

.	TRUE	/	FALSE	0	_property_session	BAh7CUkiD3Nlc3Npb25faWQGOgZFVEkiJWM4MDVhMTYyMWYxY2E0ODNmNzNiN2M3YjYxODg1YWI5BjsAVEkiGXdhcmRlbi51c2VyLnVzZXIua2V5BjsAVFsISSIJVXNlcgY7AEZbBmkEFdKLLkkiIiQyYSQwNCRXcmFRZ1lhTUVoZEpGdHJXOE9oVkwuBjsAVEkiFmN1cnJlbnRfcmVmZXJlbmNlBjsAVEkiHVcxa2xKK3JlRm5uNGloMVdFNVYwRmc9PQY7AFRJIhhhcHBsaWNhdGlvbl9jbHVzdGVyBjsARkkiFWYxYWVlZTVmNzc5NGI4OTEGOwBG--be288f878818404255e467c07fd1e5ef47b0c010


It may be formatted a bit by html but it is all one line, tab separated without newline.

Any idea what is happening?


mikeday
So the cookie is not being sent? Which operating system are you running Prince on?
pkmiec
Yes, the cookie is not being sent (I checked the raw headers on the server side). The server then rejects the request and prince prints out the warning,

prince: http://10.0.1.239:8080/photos/1003.jpg?style=medium&1389405081: warning: The requested URL returned error: 401 Unauthorized

$ prince --version
Prince 9.0 rev 4
Copyright 2002-2013 YesLogic Pty. Ltd.

$ uname -a
Linux ci3.xxx.xxx 2.6.32-358.14.1.el6.x86_64 #1 SMP Tue Jul 16 23:51:20 UTC 2013 x86_64 x86_64 x86_64 GNU/Linux

$ cat /etc/redhat-release 
CentOS release 6.4 (Final)


I tried adding -v to the prince command line but it doesn't say anything about the cookie.

mikeday
Can you try running curl with the --cookie-jar option on the same URL? eg.
curl --cookie-jar FILE URL

Prince uses the system curl library, so it should behave similarly.
pkmiec
I see what's going on. Note, the first element in my cookiejar is "." which according to the spec is the domain.

That works in my prince 6 because it is statically linked with old version of curl. It does not work with prince 9 because it is dynamically linked with newer version of curl. The new version of curl no longer supports "." as the domain.

I'll need to update my cookiejar file,
Thanks.