Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Is sub-domain considered cross-domain?

Is http://nonsecure.form.xyz.org and https://secure.form.xyz.org considered different domain? I am asking this because my javascript in secure one cannot call it's parent. Secure domain is inside non-secure domain through an iframe.

EDIT

Conclusion

You can perform cross-domain scripting but cannot perform cross-protocol scripting (e.g. https and http)

like image 328
Jaspero Avatar asked Sep 26 '11 22:09

Jaspero


People also ask

Is a subdomain a separate domain?

While a subdomain is part of the main website, it's considered a separate entity by search engines. People recognized this and decided to use subdomains to organize their website, without allowing certain parts of the site to be indexed by Google. Companies use subdomains for a variety of reasons.

What does sub domain mean?

A subdomain name is a piece of additional information added to the beginning of a website's domain name. It allows websites to separate and organize content for a specific function — such as a blog or an online store — from the rest of your website.

What is the difference between domains and subdomains?

Regular domains are your standard URLs like splashthat.com or splashthat. events. Subdomains are a unique URL that lives on your purchased domain as an extension in front of your regular domain like support.splashthat.com or blockparty.splashthat.com.

Do I need CORS for subdomain?

CORS is not allowing subdomains, so you need to specify them in your server configuration.


1 Answers

What you can do here is set document.domain = "form.xyz.org" on both sides before attempting any cross-domain scripting.

However, you cannot cross-script between different protocols.

like image 152
Daniel Brockman Avatar answered Oct 19 '22 17:10

Daniel Brockman