there I am trying to store cookies using the post method using nodejs, cookies are not stored on the browser end currently node server is running on localhost 3001 and react server is running on port 3000
the code what I have written mentioned below
Can anybody please suggest me to fix the issue
const express = require("express")
const app= express()
const cookieParser = require('cookie-parser');
const cors = require("cors")
const port = process.env.port || 3001
app.use(cors())
app.use(express.json())
app.post("/names",async(req, res)=>{
console.log("Ho")
res.cookie("auth","nagendran")
res.json({msg:"Hello"})
})