Cross Subdomain Requests

I have two URLs:

One of them is the application URL = http://domain.com/app One of them is the application URL API = http://api.domain.com/

How can I make an application request things from api in another subdomain.

I already tried to put Access-Control-Allow-Origin: * on both sides without any luck.

thank

+5
source share
2 answers

Two servers (not the client) should send the following headers:

  • Access-Control-Allow-Origin: choose which source can call the server
  • Access-Control-Allow-Methods: a method that is allowed to access the resource (GET or POST)
  • Access-Control-Max-Age: how long the cache is stored

, ( Firebug ), Cross Source.

, -, . , .

, CORS , .

+3

cookie .domain.com, . , .

0

All Articles