Send cookies

suggest change

In current browsers, fetch sends cookies on same-origin requests by default (credentials: 'same-origin'). Early implementations defaulted to 'omit'. Use 'omit' to send none, and 'include' to send them on a cross-origin request as well. A cross-origin response is still hidden unless the server sends Access-Control-Allow-Credentials: true and a specific Access-Control-Allow-Origin.

fetch('/login', {
    credentials: 'same-origin'
})
fetch('https://otherdomain.com/login', {
    credentials: 'include'
})

Feedback about page:

Feedback:
Optional: your email if you want me to get back to you:



Table Of Contents