Please answer these questions before submitting your issue. Thanks!
What version of Go and beego are you using (bee version)? Go version - 1.8
What operating system and processor architecture are you using (go env)?
L-SNVJ0NCFFT-M:$ go env
GOARCH="amd64"
GOBIN=""
GOEXE=""
GOHOSTARCH="amd64"
GOHOSTOS="darwin"
GOOS="darwin"
What did you do?
Learning GO. Trying to create a new session
In main,
func init() {
var globalSessions *session.Manager
globalSessions, _ = session.NewManager("memory", {"cookieName":"gosessionid","gclifetime":3600})
go globalSessions.GC()
}
What did you expect to see?
Function newManager is expecting pointer to struct but we are passing string.
What did you see instead?
cannot use "{\"cookieName\":\"gosessionid\",\"gclifetime\":3600}" (type string) as type *session.ManagerConfig in argument to session.NewManager
I am now getting:
multiple-value sessionkeeper.GlobalSessions.SessionStart() in single-value context
Can u please try this...
This is how i set it up in my application...
sessionConfig := &session.ManagerConfig{
CookieName: "sessionid",
Gclifetime: 3600,
}
GlobalSessions, err = session.NewManager("memory", sessionConfig)
go GlobalSessions.GC()
Thanks...
为何要修改这个?不明白。导致之前的代码编译不了。
Most helpful comment
Can u please try this...
This is how i set it up in my application...
Thanks...