Cookie Blocking in Chrome 83 and Cross-Domain SSO
Starting with Chrome version 83.0.4103.116, the browser tightened its cookie handling policies, specifically regarding third-party cookies and cross-site tracking. This update directly impacts Single Sign-On (SSO) implementations that rely on sending credentials via AJAX requests to a different domain than the one currently being visited.
The scenario involves a user visiting https://www.example.com who initiates a login flow by calling an authentication endpoint hosted on a separate domain, such as auth.example.net. To maintain session state across this cross-origin request, the client must send cookies, and the server must return them. In previous versions of Chrome, if the server included headers like Access-Control-Allow-Origin and Access-Control-Allow-Credentials, the browser would accept the response and attach the returned Set-Cookie header to the subsequent requests.
However, Chrome 83 introduced a change where cookies set by a third-party origin are now treated as tracking cookies by default unless explicitly whitelisted. When an AJAX request is made with withCredentials: true, and the server responds with a Set-Cookie header originating from the third-party domain, Chrome blocks that cookie if it determines the user has opted out of third-party cookies in their settings. The DevTools console will display the warning: "This Set-Cookie was blocked due to user preferences."
To understand why this breaks SSO, consider the flow of a typical OpenID Connect or OAuth implementation using an iframe or postMessage bridge, versus a pure AJAX login. In many legacy AJAX implementations, the authentication provider (the third party) sets a session cookie on its own domain after successful verification. The client application then needs to read that cookie or use it for subsequent API calls. If Chrome blocks this cookie because the user's settings restrict third-party data, the session is effectively lost immediately after the login response.
The core issue lies in how the browser categorizes the request. A cross-origin request from www.example.com to auth.example.net is flagged as a third-party interaction. Even if your server configuration is correctâspecifically including:
header('Access-Control-Allow-Origin: https://www.example.com');
header('Access-Control-Allow-Credentials: true');
âthe browser's new logic overrides the HTTP headers if the user's local preferences block third-party cookies. This explains why Stack Overflow, which relies on a similar mechanism for its SSO across various sites, also stopped working for users on Chrome 83. The screenshot from the original report shows the login button failing to complete because the authentication cookie was rejected before the application could process it.
There is no server-side configuration that can override this behavior when it stems from user preferences. The "fix" appears to be a client-side setting change, but applying it requires instructing millions of users to disable their third-party cookie protection, which defeats the purpose of the privacy feature Chrome introduced.
For developers facing this issue, the long-term solution involves redesigning the authentication flow to avoid relying on third-party cookies for cross-origin session management. Instead of having the auth server set a cookie that the client app must read across domains, consider using token-based authentication (like JWTs) stored in memory or local storage, which are not subject to the same strict cookie policies. Alternatively, ensure your SSO provider uses a redirect flow where the final state is achieved via URL parameters after a full page reload on the application domain, rather than relying on an AJAX call that must attach a third-party cookie immediately.
If you are building this infrastructure with Laravel, you can leverage the built-in session handling and EnsureFrontendRequestsAreStateful middleware to manage tokens more securely, avoiding the pitfalls of cross-origin cookie blocking entirely. The goal is to decouple the authentication state from the browser's third-party cookie restrictions.
