DEV Community

Discussion on: CSRF in Action 🎭

Collapse
 
nachoperassi profile image
Ignacio Perassi

He mentioned the following: "The server also adds an xsrfToken in a cookie (why cookie? cause cookies are limited by same-origin policy)."

From MDN: Access to data stored in the browser such as Web Storage and IndexedDB are separated by origin. Each origin gets its own separate storage, and JavaScript in one origin cannot read from or write to the storage belonging to another origin. Cookies use a separate definition of origins.
(developer.mozilla.org/en-US/docs/W...)