You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
When you want to save the cookie value as type map[string]string by the method func (s *session) Save() will return err like "gob: type not registered for interface: map[string]string".
Because the package "github.com/gin-contrib/sessions" uses the "encoding/gob" by default. You have to register your type beforehand by using gob.Register(map[string]string{}).
当使用session存储数组/切片/map数据类型是,在其他页面取出时会为nil,并且在没有报错的情况下导致其他后存入session的值也存储失败,全部都时nil,请看下图:
The text was updated successfully, but these errors were encountered: