Skip to content

/var/www/matt

Other blogs I follow

Kakers UK – Tech & Sysadmin

Welcome To My World of Wonder – Cristina’s Blog

Recent Posts

  • Participating in ReactRiot 2017
  • What I’m listening to – June 2017
  • Create a Webform Handler in Drupal 8
  • Using window.fetch() with Cookies

Archives

  • December 2017
  • June 2017
  • March 2017

Categories

  • Events
  • Life
  • Music
  • Tutorials
  • Web development

Meta

  • Log in
  • Entries RSS
  • Comments RSS
  • WordPress.org
Privacy & Cookies: This site uses cookies. By continuing to use this website, you agree to their use.
To find out more, including how to control cookies, see here: Cookie Policy

Tag: api

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'
}).then(//...
Posted on 2nd March 201710th March 2017Categories Tutorials, Web developmentTags api, cookies, react, web development, window.fetchLeave a comment on Using window.fetch() with Cookies
Proudly powered by WordPress