mirror of
https://github.com/astaxie/beego.git
synced 2025-07-04 10:00:18 +00:00
beego support new version session
This commit is contained in:
19
beego.go
19
beego.go
@ -191,14 +191,19 @@ func Run() {
|
||||
}
|
||||
|
||||
if SessionOn {
|
||||
sessionConfig := AppConfig.String("sessionConfig")
|
||||
if sessionConfig == "" {
|
||||
sessionConfig = `{"cookieName":` + SessionName + `,` +
|
||||
`"gclifetime":` + SessionGCMaxLifetime + `,` +
|
||||
`"providerConfig":` + SessionSavePath + `,` +
|
||||
`"secure":` + HttpTLS + `,` +
|
||||
`"sessionIDHashFunc":` + SessionHashFunc + `,` +
|
||||
`"sessionIDHashKey":` + SessionHashKey + `,` +
|
||||
`"enableSetCookie":` + SessionAutoSetCookie + `,` +
|
||||
`"cookieLifeTime":` + SessionCookieLifeTime + `,}`
|
||||
}
|
||||
GlobalSessions, _ = session.NewManager(SessionProvider,
|
||||
SessionName,
|
||||
SessionGCMaxLifetime,
|
||||
SessionSavePath,
|
||||
HttpTLS,
|
||||
SessionHashFunc,
|
||||
SessionHashKey,
|
||||
SessionCookieLifeTime)
|
||||
sessionConfig)
|
||||
go GlobalSessions.GC()
|
||||
}
|
||||
|
||||
|
Reference in New Issue
Block a user