summaryrefslogtreecommitdiffstats
path: root/modules
diff options
context:
space:
mode:
Diffstat (limited to 'modules')
-rw-r--r--modules/setting/setting.go12
1 files changed, 2 insertions, 10 deletions
diff --git a/modules/setting/setting.go b/modules/setting/setting.go
index 76e1ab7696..cda50b8e98 100644
--- a/modules/setting/setting.go
+++ b/modules/setting/setting.go
@@ -104,8 +104,7 @@ var (
EnableMemcache bool
// Session settings.
- SessionProvider string
- SessionConfig *session.Config
+ SessionConfig session.Options
// Git settings.
MaxGitDiffLines int
@@ -412,22 +411,15 @@ func newCacheService() {
}
func newSessionService() {
- SessionProvider = Cfg.MustValueRange("session", "PROVIDER", "memory",
+ SessionConfig.Provider = Cfg.MustValueRange("session", "PROVIDER", "memory",
[]string{"memory", "file", "redis", "mysql"})
-
- SessionConfig = new(session.Config)
SessionConfig.ProviderConfig = strings.Trim(Cfg.MustValue("session", "PROVIDER_CONFIG"), "\" ")
SessionConfig.CookieName = Cfg.MustValue("session", "COOKIE_NAME", "i_like_gogits")
SessionConfig.CookiePath = AppSubUrl
SessionConfig.Secure = Cfg.MustBool("session", "COOKIE_SECURE")
- SessionConfig.EnableSetCookie = Cfg.MustBool("session", "ENABLE_SET_COOKIE", true)
SessionConfig.Gclifetime = Cfg.MustInt64("session", "GC_INTERVAL_TIME", 86400)
SessionConfig.Maxlifetime = Cfg.MustInt64("session", "SESSION_LIFE_TIME", 86400)
- if SessionProvider == "file" {
- os.MkdirAll(path.Dir(SessionConfig.ProviderConfig), os.ModePerm)
- }
-
log.Info("Session Service Enabled")
}