Cookie problems submitting a https form using java
Hi,
I've been trying to use java to submit a form via https, and the connection is fine, but the form i am trying to emulate has a cookie checker that will redirect you to an error page if you don't have cookies enabled. Now I looked at the cookies for the page in firefox, and it looks like the cookie I want to use is called:
AD_TEST_COOKIES, which has an expiration of Session,
now for some reason, when I set the request header, i still get redirected incorrectly.. this is the code I'm using:
conn.setRequestHeader("Set-Cookie","AD_TEST_COOKIES=1");
I've also tried various variations such as:
conn.setRequestHeader("Cookie","AD_TEST_COOKIES=1");
conn.setRequestHeader("Set-Cookie","AD_TEST_COOKIES=1; path=/; domain=.site.com; expires=Sun, 17-Jan-2038 19:14:07 GMT");
conn.setRequestHeader("Set-Cookie","AD_TEST_COOKIES=1; path=/; domain=.site.com; expires=session);
etc..
None of them seemed to work... is there something else that I should be doing? Or is there another name I should use to identify the cookie beside "Set cookie" and "cookie"?
Thanks a bunch for your help

