Cant add cookie into header


i copied this code

func writeCookies(c echo.Context) error {
cookie := new(http.Cookie)
cookie.Name = “username”
cookie.Value = “jon”
cookie.Expires = time.Now().Add(24 * time.Hour)
return c.String(http.StatusOK, “write a cookie”)

then added in

e.POST("/post", writeCookies)

but i didnt see any cookie in response header

what did i wrong? How can fix it
sorry about my poor english


Just tried your code (tested in postman) and I couldn’t replicate the issue. If you are still looking for an answer, let me know.