Can someone please enlighten me on how I might send Drupal
login cookie information from my Android
app back to my Drupal
site?
Below is the code I am using in my attempts:
HttpResponse response;
HttpClient httpClient = new DefaultHttpClient();
HttpPost httpPost = new HttpPost("http://test2.icerge.com/testpoint/node/");
**httpPost.addHeader("Cookie: " + USERPREFERENCES.getString(COOKIE_NAME, ""), " "+USERPREFERENCES.getString(COOKIE_VALUE, ""));**
Toast.LENGTH_LONG).show();
// TODO Auto-generated method stub
try{
List<NameValuePair> nameValuePairs = new ArrayList<NameValuePair>();
nameValuePairs.add( new BasicNameValuePair("node[title]", "sample node from app") );
nameValuePairs.add( new BasicNameValuePair("node[type]", "story") );
nameValuePairs.add( new BasicNameValuePair("node[body]", "sample app node body content") );
httpPost.setEntity( new UrlEncodedFormEntity(nameValuePairs));
response = httpClient.execute(httpPost);
Log.i("SEEMS TO WORK", response.toString());
Log.v("CODE", httpPost.getRequestLine().toString() + " - " + response.toString());
}catch(Exception e){
Log.e("HTTP-ERROR: node creation", e.toString());
}
I am using the "httpPost addHeader" line to send my cookie, but nojoy.
Can someone please direct me on this issue, please?