5

Is there a cross domain policy restriction for subdomains?

If I have an application on paint.xxxx.com which is manipulating images from image.xxxx.com, are there any cross domain problems?

I'm asking these questions, because I'm considering putting a proxy on a subdomain.

stevenvh
  • 2,971
  • 9
  • 41
  • 54
mcbjam
  • 7,344
  • 10
  • 32
  • 40

1 Answers1

5

yes the cross domain restriction applies for subdomains.

The solution is to put

document.domain = "example.com" ; // whatever your domain name is

in the top of the js file(s) for both the parent domain and the child domain

Google Document.domain and cross site and there should be a better explanation but I've had the same issue and that is what worked for me.

smugford
  • 769
  • 2
  • 10
  • 20
  • 3
    this is valid only for iframes using subdomain, where the security rules are relaxed. check http://en.wikipedia.org/wiki/Same-origin_policy#Origin_determination_rules – Felipe Sabino Feb 13 '14 at 14:26