java - Unable to send cookies through angular2 web app in post request -
im running 2 different servers on same instance different port numbers, 1 node(front-end) , tomcat(back-end).
example: http://localhost:4021 node server (angular2 web app), http://localhost:8090 tomcat server (java)
im able data 8090 before login no issues that, when login 2 cookies set browser through backend. whenever make request data these 2 cookies has sent browser every time server in request headers not being sent.
i tried sending "withcredentials: true" in request options did not worked.
let headersdefult = new headers({'content-type':'application/json;charset=utf-8'}); let requestoptions = new requestoptions({ headers: headersdefult, withcredentials: true }); httppost(link, payload): observable<any> { let url = 'http://localhost:8090/'; let self = this; return this.http.post(url, payload, requestoptions) .map(this.extractdata) .catch(this.handleerror); }
Comments
Post a Comment