I have a JavaScript application hosted on x.com that uses AJAX (via jQuery) to communicate with an Apache server hosted on a local network (with static IP, 192.168.1.5).
The Apache server provides an API that requires the user to have a specific set of cookies to use it.
My problem is that I cannot force the Apache server to set a cookie with the correct domain (192.168.1.5) so that the browser sends an cookie with an AJAX call.
Is it possible to set a cookie with an IP address as a domain? All the examples I've seen require the domain to be in the form example.org.
The scenario is as follows:
- The JavaScript application on x.com sends an AJAX authentication request to 192.168.1.5 .
- The response from 192.168.1.5 has a
Set-Cookie header that should set a cookie in the 192.168.1.5 domain. - The JavaScript application on x.com sends an AJAX request to the API at 192.168.1.5 with a cookie from step 2 as part of the request.
source share