title: JQuery $.post cross domain and credentials
body: <p>I have written a web application which uses lot's of <code>$.post</code> calls with JQuery. Now I would like to send <code>withCredentials: true</code> with it to keep a session alive, what looks like this in <code>$.ajax</code> (and also works like this):</p>
  
  <pre><code>$.ajax({
              type: 'post',
              url: 'http://example.com/server/api.php',
              crossDomain: true,
              dataType: "json",
              xhrFields: {
                  withCredentials: true
              },
              data: {
                  username : 'test',
                  password : 'test'
              },
              success: function (d) {
                  $('body').html(d.status);
              }
          });
  </code></pre>
  
  <p>This is because I would now like to upload the PHP files to my server and export the client side using Cordova. (<code>withCredentials: true</code> is only included because of testing on my localhost server)
  Can I pack this into the <code>$.post</code> call or do I need to replace all calls? (I would write a new function which would look similar to $.post)</p>