Can't carry cookie in jQuery

Discussions about Z-Way software and Z-Wave technology in general
Post Reply
MotoX
Posts: 2
Joined: 10 Sep 2017 16:32

Can't carry cookie in jQuery

Post by MotoX »

Hey guys!

So I'm new here and wanted to get in to the community by asking a fairly basic question about jQuery post requests to the z-way-server. I have gotten this to work in python but I want to try and bypass the need for a uWSGI by running the requests directly from jQuery. Might be that I end up running python later anyways but that shouldn't stop me from being able to run jQuery should it?

So, my functioning python code looks like so https://pastebin.com/MZ5vB9qq which as I said earlier, works fine!

My jQuery looks like so https://pastebin.com/MQMBsKR0 and doesn't work quite as well... The jQuery code does fetch a cookie (the login is successfull) and returns it with the second request. I do however get an error message saying the following:
XMLHttpRequest cannot load http://192.168.0.188:8083/ZWave.zway/Ru ... 8].Set(25). No 'Access-Control-Allow-Origin' header is present on the requested resource. Origin 'http://192.168.0.188' is therefore not allowed access. The response had HTTP status code 401.
As the message states, the response headers from z-way-server are saying Access-Control-Allow-Origin: *
So my question is, how can I alter the header to my own domain, which would be the same ip-adress?
Post Reply