locked
Able to set cookies with other domain RRS feed

  • Question

  • User-2041703029 posted

    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!

    Saturday, February 14, 2015 8:49 AM

Answers

All replies

  • User1779161005 posted

    One website can't get or set the cookies of another (regardless of browser settings).

    • Marked as answer by Anonymous Thursday, October 7, 2021 12:00 AM
    Saturday, February 14, 2015 8:58 AM
  • User-2041703029 posted

    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?

    Sunday, February 15, 2015 11:20 AM
  • User2008642861 posted

    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

    • Marked as answer by Anonymous Thursday, October 7, 2021 12:00 AM
    Sunday, February 15, 2015 9:45 PM