Update session
This commit is contained in:
parent
f9c07c4186
commit
fd1831052c
9 changed files with 135 additions and 27 deletions
|
@ -41,19 +41,19 @@ var (
|
|||
Cfg *goconfig.ConfigFile
|
||||
MailService *Mailer
|
||||
|
||||
LogMode string
|
||||
LogConfig string
|
||||
|
||||
Cache cache.Cache
|
||||
CacheAdapter string
|
||||
CacheConfig string
|
||||
|
||||
PictureService string
|
||||
PictureRootPath string
|
||||
|
||||
LogMode string
|
||||
LogConfig string
|
||||
|
||||
SessionProvider string
|
||||
SessionConfig *session.Config
|
||||
SessionManager *session.Manager
|
||||
|
||||
PictureService string
|
||||
PictureRootPath string
|
||||
)
|
||||
|
||||
var Service struct {
|
||||
|
@ -182,6 +182,10 @@ func newSessionService() {
|
|||
SessionConfig.SessionIDHashFunc = Cfg.MustValue("session", "SESSION_ID_HASHFUNC", "sha1")
|
||||
SessionConfig.SessionIDHashKey = Cfg.MustValue("session", "SESSION_ID_HASHKEY")
|
||||
|
||||
if SessionProvider == "file" {
|
||||
os.MkdirAll(path.Dir(SessionConfig.ProviderConfig), os.ModePerm)
|
||||
}
|
||||
|
||||
var err error
|
||||
SessionManager, err = session.NewManager(SessionProvider, *SessionConfig)
|
||||
if err != nil {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue