844412c3 by astaxie

fix #453

1 parent 299cb913
Showing 1 changed file with 9 additions and 6 deletions
...@@ -194,17 +194,20 @@ func Run() { ...@@ -194,17 +194,20 @@ func Run() {
194 if SessionOn { 194 if SessionOn {
195 sessionConfig := AppConfig.String("sessionConfig") 195 sessionConfig := AppConfig.String("sessionConfig")
196 if sessionConfig == "" { 196 if sessionConfig == "" {
197 sessionConfig = `{"cookieName":` + SessionName + `,` + 197 sessionConfig = `{"cookieName":"` + SessionName + `",` +
198 `"gclifetime":` + strconv.FormatInt(SessionGCMaxLifetime, 10) + `,` + 198 `"gclifetime":` + strconv.FormatInt(SessionGCMaxLifetime, 10) + `,` +
199 `"providerConfig":` + SessionSavePath + `,` + 199 `"providerConfig":"` + SessionSavePath + `",` +
200 `"secure":` + strconv.FormatBool(HttpTLS) + `,` + 200 `"secure":` + strconv.FormatBool(HttpTLS) + `,` +
201 `"sessionIDHashFunc":` + SessionHashFunc + `,` + 201 `"sessionIDHashFunc":"` + SessionHashFunc + `",` +
202 `"sessionIDHashKey":` + SessionHashKey + `,` + 202 `"sessionIDHashKey":"` + SessionHashKey + `",` +
203 `"enableSetCookie":` + strconv.FormatBool(SessionAutoSetCookie) + `,` + 203 `"enableSetCookie":` + strconv.FormatBool(SessionAutoSetCookie) + `,` +
204 `"cookieLifeTime":` + strconv.Itoa(SessionCookieLifeTime) + `,}` 204 `"cookieLifeTime":` + strconv.Itoa(SessionCookieLifeTime) + `}`
205 } 205 }
206 GlobalSessions, _ = session.NewManager(SessionProvider, 206 GlobalSessions, err := session.NewManager(SessionProvider,
207 sessionConfig) 207 sessionConfig)
208 if err != nil {
209 panic(err)
210 }
208 go GlobalSessions.GC() 211 go GlobalSessions.GC()
209 } 212 }
210 213
......
Styling with Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!