Session Module Docs Needs updating
Hi,
The latest version of beego session module requires usage of session.ManagerConfig instance as second parameter to session.NewManager when initalizing a session. This isn't shown in the docs, what is shown is this :
globalSessions, _ = session.NewManager("memory", {"cookieName":"gosessionid", "enableSetCookie,omitempty": true, "gclifetime":3600, "maxLifetime": 3600, "secure": false, "sessionIDHashFunc": "sha1", "sessionIDHashKey": "", "cookieLifeTime": 3600, "providerConfig": ""})
Moreover, the params in the string in this example are different now since the session module uses session.NewManager instead.
I have to say I fell into the pitfall here.
What I did is pass the string to json.Unmarshall, but it seems like json library can not handle "enableSetCookie,omitempty" correctly, the value becomes a false and my application will never set a cookie.
我在startsession源码上打断点才发现这个问题,太坑了。