XMLHttpRequest is acting strangely

  1. SDK Version: 36
  2. Platforms(Android/iOS/web/all): IOS/Android

I’m taking session cookies from somewhere else, and using XHR for request http connection.
But I found that XHR does not work with my session cookie if it receives Set-Cookie headers from the server.
(The cookies passed to the function are different from the cookies in the actual packet sent by the device.)
And I found that the only way to reset this is to delete the application and reinstall it.
Is this some kind of bug? If not, are there any solutions?

below is my code for XHR http request

function fetchEduclass(link, cookie) {
    return new Promise((resolve, reject) => {
      const request = new XMLHttpRequest();
  
      request.onload = () => {
        if (request.status === 200) {
          resolve(request.responseText);
        } else {
          reject(new Error(request.statusText));
        }
      };
      request.onerror = () => reject(new Error(request.statusText));
      request.responseType = 'text';
  
      request.open('GET', link);
      request.setRequestHeader('Cookie', `JSESSIONID=${cookie}`);
      request.send();
    });
}

This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.