As per my understanding, when third party cookies are blocked on a browser, the site cannot set cookies of other domain. To check this, I created a website and on page load added a code to set a cookie with domain name "test.com"
I hosted this website with hostname as "mysite.edu.in" and also added host entry as "127.0.0.1 mysite.edu.in"
After accessing the site, it creates a cookie with different domain "test.com" and able to access that as well (in Response.Cookies collection).
I theory it shouldn't (as I mentioned above). Am I missing anything? Note that third party cookies are blocked.
True that. Regardless of browser settings (third party cookies), as mentioned above, I am able to set cookies with domain as "test.com" on a website with domain name "mysite.edu.in".
Thank you for your post. As Brock Allen said, you couldn't set cookies for another domain. As your statement, I suppose that your web applications run in the same environment. That's to say, it may still have some cache in the console. I suggest that you
could clean your console and reset your environment, then have a test.
For more information, I suggest that you could refer to below links.
Member
1 Points
12 Posts
Able to set cookies with other domain
Feb 14, 2015 08:49 AM|Deepak61088|LINK
As per my understanding, when third party cookies are blocked on a browser, the site cannot set cookies of other domain. To check this, I created a website and on page load added a code to set a cookie with domain name "test.com"
I hosted this website with hostname as "mysite.edu.in" and also added host entry as "127.0.0.1 mysite.edu.in"
After accessing the site, it creates a cookie with different domain "test.com" and able to access that as well (in Response.Cookies collection).
I theory it shouldn't (as I mentioned above). Am I missing anything? Note that third party cookies are blocked.
Thanks!
Cookie
All-Star
20376 Points
6505 Posts
ASPInsiders
MVP
Re: Able to set cookies with other domain
Feb 14, 2015 08:58 AM|BrockAllen|LINK
One website can't get or set the cookies of another (regardless of browser settings).
Cookie
DevelopMentor | http://www.develop.com
thinktecture | http://www.thinktecture.com/
Member
1 Points
12 Posts
Re: Able to set cookies with other domain
Feb 15, 2015 11:20 AM|Deepak61088|LINK
True that. Regardless of browser settings (third party cookies), as mentioned above, I am able to set cookies with domain as "test.com" on a website with domain name "mysite.edu.in".
Am I missing anything?
Cookie
Contributor
5642 Points
944 Posts
Re: Able to set cookies with other domain
Feb 15, 2015 09:45 PM|Archer Wang|LINK
Hi Deepak61088,
Thank you for your post. As Brock Allen said, you couldn't set cookies for another domain. As your statement, I suppose that your web applications run in the same environment. That's to say, it may still have some cache in the console. I suggest that you could clean your console and reset your environment, then have a test.
For more information, I suggest that you could refer to below links.
https://msdn.microsoft.com/en-us/library/ms178194(v=vs.140).aspx
http://stackoverflow.com/questions/6761415/how-to-set-a-cookie-for-another-domain
Hope this could be helpful to you.
Best regards,
Archer
Cookie