Which Website Can Read This Response?
Compare approved and untrusted origins reading the same user-scoped API response under the stated cookie conditions.
You’re reading a preview. Premium includes the full lesson and specialist practice. View the full curriculum.
One response, two requesting websites
Mia's work-list API returns only her own tasks. The trusted team website should be able to read that response. An untrusted website open in the same browser should not gain that access.
This is a CORS question. CORS is the browser's mechanism for deciding whether a requesting website's script may read a response from another origin.
Separate sending, serving, and reading
Browser sends a request → API chooses Mia's data → browser decides whether this website may read it
The original API reflects any incoming Origin into Access-Control-Allow-Origin and allows credentials. Under the credentialed scenarios, we explicitly assume the browser is permitted to send the API session cookie. Setting credentials: include alone does not override cookie policy.
The API's user filter can remain correct while the browser shares the result with the wrong website.