D
D
desecho2010-12-13 02:46:51
linux
desecho, 2010-12-13 02:46:51

Difference in cookie handling between wget and curl. wtf?

These commands produce different results:
wget --load-cookies=cookies.txt www.example.com
curl -b cookies.txt www.example.com
Wget is fine. Curl throws a 403 error. The problem is that I need to POST, but wget doesn't support multipart/form-data. Therefore, you need to use curl.
How to get around the problem and why is this happening?

Answer the question

In order to leave comments, you need to log in

2 answer(s)
P
peter23, 2010-12-13
@peter23

Maybe UserAgent?
Also tried saving cookies from locally installed phpMyAdmin. The line in the file saved by wget looks like this:

127.0.0.1 FALSE /pma/ FALSE 1294809105 pma_theme original

And curl is like this:
#HttpOnly_127.0.0.1 FALSE /pma/ FALSE 1294809043 pma_theme original

In general, this is a Netscape HTTP Cookie File, but I'm confused by the comment at the beginning of the line that curl puts in.

S
stampoon, 2010-12-16
@stampoon

Change user agent, curl -A "user agent string"

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question