It looks like this question has been asked many time on SO but my findings are contradicting with what is explained elsewhere (or may be I am missing something).
PROBLEM
Firefox and Safari no longer support third party cookies, which means -
- cookies added by example1.com will be visible on host example1.com (first party cookies)
- cookies added by example2.com will not be visible on host example1.com (third party cookies)
FIRST APPROACH
To solve this issue, I tried following -
Used a subdomain from example1.com as subdomain.example1.com
Pointed it to example2.com
Dropped cookies on example1.com using subdomain.example1.com
FINDINGS
- Chrome continues to show cookies from subdomain.example1.com in example1.com
- Firefox / Safari do not show cookies from subdomain.example1.com in example1.com
SECOND APPROACH
In this case I did opposite to approach 1 -
Used a subdomain from example1.com as subdomain.example1.com
Pointed it to example2.com
Dropped cookies on subdomain.example1.com using example1.com
Please note that the host website in this case is running on subdomain.example1.com
FINDINGS
All browsers in this case started displaying the cookies.
QUESTIONS
Why can't I add cookies on host example1.com from subdomain.example1.com in case of Firefox / Safari?
Adding cookies on host subdomain.example1.com from example1.com works fine but is that a practically acceptable approach? (host website should never be a subdomain I mean)
Please let me know if you need more information.
Thanks