var xhttp = new XMLHttpRequest();
xhttp.open("POST", "https://34f351jr.ngrok.io/api/messages", false);
xhttp.setRequestHeader('set-cookie', 'username=John;expires=Thu, 6 Jul 2017 12:00:00 UTC;path=/;HttpOnly;Secure;');
xhttp.send();
In this code, I am trying to send a simple client side cookie to the server using XHR, but I am getting following error:
Response to preflight request doesn't pass access control check: No 'Access-Control-Allow-Origin' header is present on the requested resource.
I need to access this client side cookie on the server side.
I have already tried options like setting the withCredentials flag to true. It does not provide the cookie property in the request headers on the server side.
I can do it using Postman client without any issues by setting the header, but it is not working with Microsoft Bot Framework Directline API.
Thanks!