title: passing cookie data on MeteorJS HTTP request
body: <p>It already took me several hours implementing cookie on url MeteorJS. What I need to do is that, pass a cookie data n url like 'CURLOPT_COOKIE' PHP. I cant find any example code on their docs and even to forums. For now I have these functions:</p>
  
  <pre><code>/* HTTP REQUEST */
  Meteor.methods({
     httpRequest: function(type, uri, params){
      this.unblock();
      check(type, String);
      check(uri, String);
      check(params, Object);
      try {
          var result = HTTP.call(type, uri, {params: params});
          return result;
      } catch (e) {
          // Got a network error, time-out or HTTP error in the 400 or 500 range.
          return e;
      }
     }
  });
  // HTTP request with cooki
   getUserDetails: function(session_id, uid){
    var params = {
       headers: {
        Cookie: {
          sessid: session_i
        }
      },      
      uid: uid
    };
    var response =  Meteor.call('httpRequest', "POST", "http://example.com/rest/wp /alt_wp_resources/loaduser.json", params);
    //res = JSON.parse(response.content);  
    return response;
  }
  // call here
  Meteor.startup(function () {
  // delay for 5 sec
  Meteor.setTimeout(function (){
      Meteor.call('getUserCredentials', 'api12345', '123qweasd', function (error, result) {                   
      // check user authentication
      var success = result.success;
      console.log(result);
      // user has account from lpgp site, let's save him to meteor.
      if (success){
          console.log('success');
          var session_id = result.session_id;
          //console.log(_session_id);
          Meteor.call('getUserDetails', 'SESSba071091c09f79fefd66e4884dcdde50', 68558, function (error, result) {
              if (!error)
                  console.log(result);
              else
                  console.log(error);         
          });         
      }else
          // app can't find user account from lpgp site.
          console.log(error);             
  });
  }, 5000);
  });
  </code></pre>
  
  <p>The call is successful but, just returned a success: false.</p>
  
  <p>Response:</p>
  
  <pre><code>Object {statusCode: 200, content: "{"success":false}", headers: Object, data: Object}
  </code></pre>