fix #453
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 | ... | ... |
-
Please register or sign in to post a comment