WWW request has missing Cookie header.

I’ve been upgrading our project from unity 5.4 to unity 2017.1 and have struck a problem with our WebGL build. Previously we would send an init request to the server which would return us a cookie in the response headers (Set-Cookie header) and then this cookie would end up in the following requests to the server in a Cookie header. we never touched the cookie in our CS code so presumably either the WWW class or the browser itself just handled it. Now with 2017.1 we make the same init request to our server, we receive the set-cookie header back as expected but the following requests to the server do not have a cookie in the request headers. What am I doing wrong?

We have found the issue. In our codebase we have the following code (run when the page loads):

(function(window) {
  var original = XMLHttpRequest;
  window.XMLHttpRequest = function() {
    var x = new original;
    x.withCredentials = true;
    return x;

Due to some reasons I had deleted the file that contained it without knowing this had gone too. This code lets the browser set the authentication of the requests and fixes the problem.