javascript - XMLHttpRequest to another subdomain with cookie persistence?

one text

I am using XMLHttpRequest to submit data from a form on one subdomain to another. The code below is an example. However when doing so the PHP code in the page being requested notices that no cookie was set even if multiple requests were made. The PHP code thus needs to create a new cookie for each request. How is is possible for the cookie to persist in the target subdomain if multiple requests are made?

It will be difficult for me to change the cookie/session settings from the calling subdomain.

var url = "https://www.example.com/page.php?param=value"
var xmlHttp = new XMLHttpRequest();
xmlHttp.open( "GET", url, false ); 
xmlHttp.send( null );

Source