Using window.fetch() with Cookies

Have you ever found that using window.fetch() doesn’t automatically send your session’s cookies back to the server?

Simply modify your code to the following and it’ll all work nicely again!

fetch('/api/endpoint', {
    credentials: 'same-origin'

Published by

Matt Arnold

Developer of bespoke addons for Sage 200c

Leave a Reply

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