I have a Java app (not a servlet) that passes an ID & a password to a webpage and receives two cookies in return.

I am trying to go to the next webpage by sending the cookies back, but that is failing -- I am pretty sure that I am sending the cookies incorrectly.

A snippet of my code is below -- does anyone have any ideas? Thank you!

URL url2 = new URL("http://sctweb11.sctcorp.com/awsearch/sct/sctlogin.asp");
HttpURLConnection lobjConnection = (HttpURLConnection) url2.openConnection();

//I am using IBM VisualAge for Java, & I'm not sure if it takes "cookie" or "set-cookie", so I'm doing both.
//If I try to set the cookies twice, only one of them is there when I do a getRequestProperty.
lobjConnection.setRequestProperty("cookie", "IIDENT=1229;ICNTCT=129");
lobjConnection.setRequestProperty("set-cookie", "IIDENT=1229;ICNTCT=129");
lobjConnection.setDoOutput(true);