2

I've been able to store a custom cookie but I'm trying to save it for a session the store it in the database when a form is submitted. I use:

func (c Application) Index(id string) revel.Result {
cookie := http.Cookie{Name: "id", Value: id, Domain: "localhost", Path: "/"}
c.SetCookie(&cookie)
return c.Render()
}

but I cannot access it again. How could I retrieve it in a different function?

Thank you!

vinniyo
  • 787
  • 2
  • 8
  • 21

1 Answers1

3

I was going about it all wrong. Revel sets cookies with the session.

Set: 
    c.Session[key] = value

Get:
    c.Session[key]
ORHAN ERDAY
  • 1,020
  • 8
  • 31
vinniyo
  • 787
  • 2
  • 8
  • 21