Skip to content

Pass cookies with Fetch API call

JavaScripts fetch() API doesn’t pass cookies by default, but if you are working with sessions, for example, you need to pass the cookies with the API call. You can do that by including the option credentials: "include":

[sc name=”src” url=”https://stackoverflow.com/questions/34558264/fetch-api-with-cookie” ]

Be First to Comment

Leave a Reply

Your email address will not be published. Required fields are marked *

This site uses Akismet to reduce spam. Learn how your comment data is processed.