https://developer.mozilla.org/en-US/docs/Web/API/XMLHttpRequest/withCredentials
https://localcoder.org/how-do-i-set-a-cookie-header-with-xmlhttprequest-in-javascript
Even if those work you might still face a Cors issue anyway, in most places online I've mostly seen people just saying that this is not possible with xmlhttpRequest.
How do I send a cookie with GM_xmlhttpRequest?
I tried
but it doesn't seem to set the cookie to that