After latest Safari update (version 14), we face strange issue with part of our Web app not loading properly.
The app consists of two parts, main domain and sub domain where each has its own dedicated server (sub domain server can call main domain server but not the other way around). On an application load, main domain server handles authentication which sets an SID
cookie. Sub domain opens on user interaction from within an iframe
to ensure that opening sub domain always goes throughout main domain authentication. In the sub domain iframe
, there is additional security request against sub-domain-server that sets sessionToken
cookie for the sub domain (using Set-Cookie
response header). After this initial loading phase, sub domain makes bunch of requests against both servers which requires above cookies to be set (obviously, for proper authorization).
What is different between Safari version 14 and previous Safari versions (or any other browser) is that none of the subsequent calls to the sub domain server has ANY cookie set. Contrary (and correctly), requests that go against main domain have all expected cookies.
When I check the cookies storage for both domains, I can see that:
SID
mentioned above) but not the cookie set by an iframe
request (sessionToken
)So it almost looks like Safari blocks the sub domain requests from within an iframe
from:
Set-Cookie
response headerTo make things more complete, this problem does not occur:
My understanding so far is that Safari does this intentionally, thinking that the iframe
opening sub domain is an add-tracker, protecting the client. But I've read heaps of articles about Safari's ITP and understood that ITP doesn't protect sub-domains in the same way which is contradicting my use case.
So my questions are. Does anyone knows why:
As per Safari 14 Version :- All third-party cookie access is blocked.
I also faced this in my company PRD
server, we were setting cookie from within Iframe
using sub-domain.
This happens because this case falls under first-party bounce code flow, hence Safari also protects against first-party bounce tracking.
Bounce tracking happens when instead of navigating the user directly to the target domain, the user is redirected through intermediate domains which can set cookies and build a profile of the user. Intelligent Tracking Prevention detects when domains are used solely for bounce tracking and clears all website data that might have been saved on them.
Source https://www.cookiestatus.com/
We've added this message to our users:
Please go to Settings > Safari > Privacy & Security and uncheck Prevent Cross-Site Tracking and Block All Cookies.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With