Have you configured CORS?
I guess that I should add some line in configuration file. I found this line in other posts:
< entry key='web.origin'>*< /entry>
but I can't find it in documentation on site
https://www.traccar.org/configuration-file/
Should I add it for the newest Traccar version?
I guess that I also need to configure my webapp. Can I find somewhere any example how to do it correctly ?
The configuration parameter is still available in the latest release:
https://github.com/traccar/traccar/blob/master/src/org/traccar/api/CorsResponseFilter.java#L48
Ok, thanks for quick help
I've added web.origin line in default.xml file and created session with request headers like this:
this.headers = this.headers.set('Accept', '*/*');
this.headers = this.headers.set('Content-Type', 'application/x-www-form-urlencoded; charset=UTF-8');
I'm getting Set-Cookie header in response, but it's not being set for other requests. Still getting 401 for them
Ok i found a solution. I had to add withCredentials: true option in HttpOptions, thanks for help Anton ;)
Hi, I'm working on application in AngularJS, which I want to integrate with Traccar API. I have a problem with creating session. I'm sending a POST request with valid credentials, it gives 200 status code, but authorization cookie is not being set. Without any headers modifications, API returns 401 on other requests. I've read in internet that it can be a problem with Http headers, but when I'm trying to configure headers in many different ways, each time Chrome Console says somethin like:
I've never get it working yet.
What can I do to fix it ? Thanks for help