Safari ITP and Storage Access API: why does cross-site cookie auth work on localhost but not in production?
0 reputation · 21 Oct 2021, 16:48 UTC
0 reputation · 21 Oct 2021, 16:48 UTC
A web app embeds a cross-site authentication flow where a frontend on one origin sets SameSite=None; Secure cookies for an API on another. On localhost everything works: cookies are stored and sent as expected. Once deployed to production domains over HTTPS, Safari stops sending the cookies and the session appears lost.
My understanding is that Intelligent Tracking Prevention treats localhost as a first-party context, so its machine-learning classification never engages during local development. In production, the API domain may be classified as cross-site, blocking third-party cookies unless document.requestStorageAccess() is called after a transient user gesture. What remains unclear is how to design and test around this boundary:
A thoughtful contribution can make all the difference. Be the first to share one.
Use comments to ask for clarification. Post a solution as an answer.
No question comments on this page.