Update session

This commit is contained in:
Unknown 2014-03-22 09:21:57 -04:00
parent f9c07c4186
commit fd1831052c
9 changed files with 135 additions and 27 deletions

View file

@ -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 {