Juicyjuice 0 Newbie Poster
import org.apache.commons.httpclient.HttpClient;
import org.apache.commons.httpclient.methods.PostMethod;


public class sslRequest {
    
	public void run(){
		String url = "https://pipeline.sbcc.edu/cp/home/login";
		   try {
			   HttpClient client = new HttpClient();
			   //client.getParams().setParameter("http.protocol.single-cookie-header", true);
			   // client.getParams().setCookiePolicy(CookiePolicy.BROWSER_COMPATIBILITY);

			   PostMethod method = new PostMethod( url );

			   // Configure the form parameters
			   method.addParameter("user", "username" );
			   method.addParameter("pass", "password123" );
			   method.addParameter("uuid", "********-f08d-4d64-aeef-************");
			   // Execute the POST method
			   int statusCode = client.executeMethod( method );
			   if( statusCode != -1 ) {
				   String contents = method.getResponseBodyAsString();
				   method.releaseConnection();
				   System.out.println( contents );
			   }
		   }
		   catch( Exception e ) {
		    e.printStackTrace();
		   }
    }
}

Running this code I fail to login to the site and get this error message:

Nov 6, 2011 12:41:46 PM org.apache.commons.httpclient.HttpMethodBase processCookieHeaders
WARNING: Cookie rejected: "$Version=0; WebCTTicket=; $Path=/; $Domain=webct.cookie.domain". Illegal domain attribute "webct.cookie.domain". Domain of origin: "pipeline.sbcc.edu"

I've tried tampering with the all of the different cookiepolicies HttpClient offers, but still no luck. I don't know how to get HttpClient to ignore the different domain attribute. Any help would be greatly appreciated :)

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.