Hello!I'm trying to read a cookie without success.To set a cookie, I write:expiration := *time.LocalTime()expiration.Year += 1cookie := http.Cookie{Name: "browserID", Value: "my value", Expires: expiration}http.SetCookie(w, &cookie)
To read, I write (without success):cookie, _ := r.Cookie("browserID")fmt.Fprint(*w, cookie)
How are you calling this code?
Why do you have a *http.ResponseWriter instead of just a http.ResponseWriter?
> This gives:
>
> http: named cookied not present.
> I use the most recent appengine btw. Beginning to suspect it's bugged.
--
=====================
http://jessta.id.au
Definitely not.
Just pass it as a http.ResponseWriter.
(Usually you don't want pointers to interface values.)
Chris
--
Chris "allusive" Dollin
Like all other values in Go, interface values are passed by value.
But like some other values in Go (eg slices, strings, maps, channels)
the internal structure of an interface value may point to other values.
If an interface variable contains a "big" value, then internally there
will be a pointer to a copy of that value. Copying interface values
is cheap.
> I'm trying to avoid the object being copied; is that unnecessary?
Yes. (In this case, anyway.)