I have a simple server written on Golang and it's supposed to handle login requests and set some cookies. But the problem is that i cant access the cookies inside my React Js project I set the cookies with this code:
if OTPValidate.Result.Status == "success" {
log.Println("Setting Cookies")
session := sessions.DefaultMany(ginContext, "session")
session.Set("MobileNumber", Number)
session.Set("GUID", OTPValidate.GUID)
session.Set("PersonId", OTPValidate.PersonID)
if err != nil {
logger.Error(logger.FuncName() + err.Error())
}
session.Options(sessions.Options{MaxAge: 2592000}) // 30 Day
session.Save()
}
and currently using Cookies Js to get the cookies:
const cookie = Cookies.get('session')
console.log(cookie)
but it prints undefined I checked the request header inside the network tab in the browser and it seems fine:
But still I'm not able to get them into the react