mirror of
https://github.com/astaxie/beego.git
synced 2024-12-23 14:30:49 +00:00
15 lines
312 B
Go
15 lines
312 B
Go
|
package middleware
|
||
|
|
||
|
import (
|
||
|
"github.com/astaxie/beego/session"
|
||
|
)
|
||
|
|
||
|
var (
|
||
|
GlobalSessions *session.Manager
|
||
|
)
|
||
|
|
||
|
func StartSession(provideName, cookieName string, maxlifetime int64, savePath string) {
|
||
|
GlobalSessions, _ = session.NewManager(provideName, cookieName, maxlifetime, savePath)
|
||
|
go GlobalSessions.GC()
|
||
|
}
|