0

I have developed an API using Node JS. I have enable cors so that i can fetch data using that API in some different project. I am comfortable in making GET/POST Request from react JS.

fetch(https://www.api.com/getusers) I am OK with this

But lets say along with data backend also send some cookies. How to send those cookies to client.

Client Make a Request Login Request (Login Credentials) -> Make a GET request to backend to match the credentials -> Credentials Matched -> Sent a cookie in Response to React -> Now how to send this cookie to Browser

Moreover how to get back that cookie from browser through react so re-verify user

I am very confused in this Pls Help !!

A explanation how to handle logIn, Signup or Retrieving cookie from browser through react

  • [JWT](https://medium.com/@vrinmkansal/quickstart-jwt-based-login-for-react-express-app-eebf4ea9cfe8) is your friend ^^ – moonwave99 Nov 12 '22 at 15:04

0 Answers0