0

React js not sending cookie, I am using react-redux thunk for sending request, all requests are sent are not using the cookie session id.

Because of missing session id, the server generate new cookie on each request and connot identify the user requests.

How can I make it work?

1 Answer 1

0

Please add parameter credentials: 'same-origin' to your request,

Example request:

fetch(url, {
    credentials: 'same-origin', //This was added
    method: 'GET',
    headers: {
      'Accept': 'application/json',
      'Content-Type': 'application/json'
    }})
Sign up to request clarification or add additional context in comments.

2 Comments

This did not help
whats is your request?

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.