This error message is usually encountered when attempting to set the "cookie" header in an XMLHttpRequest (XHR) request.

The "Refused to set unsafe header 'cookie'" error is a security measure implemented by modern browsers to prevent cross-site scripting (XSS) attacks. It prohibits explicitly setting the "cookie" header in XHR requests because it could potentially lead to unauthorized access to sensitive user data.

To resolve this issue, you should remove the code that sets the "cookie" header in your XHR request. The browser will automatically handle the cookies for you

xhrjs164 Refused to set unsafe header cookie