Set-Cookie in response header is not saved into browser cookie storage Set-Cookie in response header is not saved into browser cookie storage google-chrome google-chrome

Set-Cookie in response header is not saved into browser cookie storage


This problem occur due to multiple responses from server to client.

For example if you are sending a response to the server using response.send() and same time using you are using response.setHeader()

This problem can be solve by creating cookie in client side using javascript.And reading its value from node.js


The answer is because i used fetch() API that have to pass {credentials => 'same-origin'} option.