我已经能够存储自定义 cookie,但我试图将其保存为会话,并在提交表单时将其存储在数据库中。我用:
func (c Application) Index(id string) revel.Result {
cookie := http.Cookie{Name: "id", Value: id, Domain: "localhost", Path: "/"}
c.SetCookie(&cookie)
return c.Render()
}
但我无法再次访问它。我怎样才能在不同的功能中检索它?
谢谢!