views:

1813

answers:

2

I'm working on a script that logs into WordPress, however, HttpClient's cookie policy identifies the cookies set by WordPress to be invalid:

May 17, 2009 12:07:43 PM org.apache.commons.httpclient.HttpMethodBase processCookieHeaders
WARNING: Cookie rejected: "$Version=0; wordpress_dce2080bc042b2e639e4f5b3b704aa43=admin%7C1243786064%7C4c56aef46b1210d3d43d8b829fdf4d9a; $Path=/wp-content/plugins". Illegal path attribute "/wp-content/plugins". Path of origin: "/wp-login.php"
May 17, 2009 12:07:43 PM org.apache.commons.httpclient.HttpMethodBase processCookieHeaders
WARNING: Cookie rejected: "$Version=0; wordpress_dce2080bc042b2e639e4f5b3b704aa43=admin%7C1243786064%7C4c56aef46b1210d3d43d8b829fdf4d9a; $Path=/wp-admin". Illegal path attribute "/wp-admin". Path of origin: "/wp-login.php"

Without cookie support, the script can't login. How can I get around this?

(Using HttpClient 3.1)

+1  A: 

Take a look at this page, HttpClient Cookie Guide, and see if adjusting the cookie policy fixes your problem.

EDIT:

More specifically, try the Netscape Draft policy and see if its relaxed restrictions work with the WordPress cookies.

jkf
No luck. I've tried all the available cookie policies, none of them had any affect.
Alex
A: 

Can you register your own Cookie Policy that is more relaxed?

Kevin