Commit 844412c3 authored by astaxie's avatar astaxie

fix #453

parent 299cb913
...@@ -194,17 +194,20 @@ func Run() { ...@@ -194,17 +194,20 @@ func Run() {
if SessionOn { if SessionOn {
sessionConfig := AppConfig.String("sessionConfig") sessionConfig := AppConfig.String("sessionConfig")
if sessionConfig == "" { if sessionConfig == "" {
sessionConfig = `{"cookieName":` + SessionName + `,` + sessionConfig = `{"cookieName":"` + SessionName + `",` +
`"gclifetime":` + strconv.FormatInt(SessionGCMaxLifetime, 10) + `,` + `"gclifetime":` + strconv.FormatInt(SessionGCMaxLifetime, 10) + `,` +
`"providerConfig":` + SessionSavePath + `,` + `"providerConfig":"` + SessionSavePath + `",` +
`"secure":` + strconv.FormatBool(HttpTLS) + `,` + `"secure":` + strconv.FormatBool(HttpTLS) + `,` +
`"sessionIDHashFunc":` + SessionHashFunc + `,` + `"sessionIDHashFunc":"` + SessionHashFunc + `",` +
`"sessionIDHashKey":` + SessionHashKey + `,` + `"sessionIDHashKey":"` + SessionHashKey + `",` +
`"enableSetCookie":` + strconv.FormatBool(SessionAutoSetCookie) + `,` + `"enableSetCookie":` + strconv.FormatBool(SessionAutoSetCookie) + `,` +
`"cookieLifeTime":` + strconv.Itoa(SessionCookieLifeTime) + `,}` `"cookieLifeTime":` + strconv.Itoa(SessionCookieLifeTime) + `}`
} }
GlobalSessions, _ = session.NewManager(SessionProvider, GlobalSessions, err := session.NewManager(SessionProvider,
sessionConfig) sessionConfig)
if err != nil {
panic(err)
}
go GlobalSessions.GC() go GlobalSessions.GC()
} }
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment