I\'m trying to use Go to log into a website and store the cookies for later use.
Could you give example code for posting a form, storing the cookies, and accessing a
Another way of doing it. Works in Go 1.8.
expiration := time.Now().Add(5 * time.Minute) cookie := http.Cookie{Name: "myCookie", Value: "Hello World", Expires: expiration} http.SetCookie(w, &cookie)