> The Cookie session is encoded with gob Encode. It should only contain
plain text strings right?
No. Where did you get that idea? See
https://pkg.go.dev/encoding/gob#hdr-Encoding_Details
On Fri, Jul 21, 2023 at 3:32 PM Tong Sun wrote:
> Hi Gophers,
>
> I'm facing a very weird error:
>
> func g
Hi Gophers,
I'm facing a very weird error:
func getUserName(w http.ResponseWriter, r *http.Request) string {
c, err := r.Cookie("session")
if err != nil {
http.Redirect(w, r, rootUrl, http.StatusSeeOther)
return ""
}
log.Println("session raw", c.Value)
var s session
fmt.Printf("%+v\n", s)
reade