Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR JAVASCRIPT

react does not send the cookie automatically

fetch and axios indeed do not send credentials automatically with the request,
you will have to specify it by setting the "withCredentials" option to true:

axios.get(`api.com/api`, { withCredentials: true })
  .then((res) => {
    // code
  })
Source by stackoverflow.com #
 
PREVIOUS NEXT
Tagged: #react #send #cookie #automatically
ADD COMMENT
Topic
Name
6+7 =