title: Sending cookies using POST in PhoneGap
body: <p>I am making a mobile application using PhoneGap. To authenticate a user, I send the data using the <code>.ajax()</code> command in jQuery. This sends me a cookie in return and I am able to access the cookie and the contents of the cookie. </p>
  
  <p>The next step is to make another API request and this involves sending the cookie that I received in the previous step. I am trying to do something like this:</p>
  
  <pre><code>$.ajax({
         url:"https://SomeDomain.asmx/getProjectList",
         type:"jsonp",
  
         xhrFields: {
                 withCredentials: true
         },
  
         beforeSend: function(xhr) {
         xhr.setRequestHeader("Cookie", "ASP.NET_SessionId");
         },
  
         contentType: "application/json; charset=utf-8",
         data: JSON.stringify(textJson),
  
         success: function(result){
                alert('success');
         },
         error: function(result){
                console.log(result);
         }
  
  });
  </code></pre>
  
  <p>At the moment, the response is the text of a <code>404 Not Found</code> error page. Is it because there is something wrong with the cookie that I am attaching to the request ? </p>
  
  <p>PS - I don't have access to the server side code. I'm just sending data to a web service.</p>