24
rated 0 times
[
28]
[
4]
/ answers: 1 / hits: 16679
/ 13 Years ago, mon, april 18, 2011, 12:00:00
Say I have two apps, www.test.com and sub.test.com, now in sub.test.com, I create a window to load www.test.com with codes like :
window.open('www.test.com');
So the window just popup and load 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 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 www.test.com, it can't get it.
Then I found that if I don't use window.open but directly open www.test.com in browser, it works.
So is there some restrictions on window.open and cookie?
More From » browser