Send cookies

suggest change

The fetch function does not send cookies by default. There are two possible ways to send cookies:

  1. Only send cookies if the URL is on the same origin as the calling script.
    fetch('/login', {
        credentials: 'same-origin'
    })
  2. Always send cookies, even for cross-origin calls.
    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