Say I have two apps, http://www.test.com and sub.test.com, now in sub.test.com, I create a window to load http://www.test.com with codes like :
window.open('www.test.com');
So the window just popup and load http://www.test.com successfully.
Then I set a cookie in sub.test.com, say “uname=wong2;domain=.test.com”, I’ve learned that with set to domain=.test.com, all sites with domain test.com(such as http://www.test.com, aaa.test.com, test.com) can read the cookie.
But when I try to load the cookie from the window that just popup with http://www.test.com, it can’t get it.
Then I found that if I don’t use window.open but directly open http://www.test.com in browser, it works.
So is there some restrictions on window.open and cookie?
just check how you set the cookie: