Due to weird domain/subdomain cookie issues that I\'m getting, I\'d like to know how browsers handle cookies. If they do it in different ways, it would also be nice to know
Will
www.example.com
be able to set cookie for.com
?
No, but example.com.fr
may be able to set a cookie for example2.com.fr
. Firefox protects against this by maintaining a list of TLDs: http://securitylabs.websense.com/content/Blogs/3108.aspx
Apparently Internet Explorer doesn't allow two-letter domains to set cookies, which I suppose explains why o2.ie
simply redirects to o2online.ie
. I'd often wondered that.
The RFCs are known not to reflect reality.
Better check draft-ietf-httpstate-cookie, work in progress.
I tested all the cases in the latest Chrome, Firefox, Safari in 2019.
Response to Added: