Browse Source

Merge pull request #508 from joubertredrat/fix-cookie-name

Fix default cookie name
tags/v1.1.0
Andrey Nering 7 years ago
parent
commit
edfa76d3f5
2 changed files with 3 additions and 3 deletions
  1. 2
    2
      conf/app.ini
  2. 1
    1
      modules/setting/setting.go

+ 2
- 2
conf/app.ini View File

; Domain name to be exposed in clone URL ; Domain name to be exposed in clone URL
SSH_DOMAIN = %(DOMAIN)s SSH_DOMAIN = %(DOMAIN)s
; Network interface builtin SSH server listens on ; Network interface builtin SSH server listens on
SSH_LISTEN_HOST =
SSH_LISTEN_HOST =
; Port number to be exposed in clone URL ; Port number to be exposed in clone URL
SSH_PORT = 22 SSH_PORT = 22
; Port number builtin SSH server listens on ; Port number builtin SSH server listens on
; mysql: go-sql-driver/mysql dsn config string, e.g. `root:password@/session_table` ; mysql: go-sql-driver/mysql dsn config string, e.g. `root:password@/session_table`
PROVIDER_CONFIG = data/sessions PROVIDER_CONFIG = data/sessions
; Session cookie name ; Session cookie name
COOKIE_NAME = i_like_gogits
COOKIE_NAME = i_like_gitea
; If you use session in https only, default is false ; If you use session in https only, default is false
COOKIE_SECURE = false COOKIE_SECURE = false
; Enable set cookie, default is true ; Enable set cookie, default is true

+ 1
- 1
modules/setting/setting.go View File

SessionConfig.Provider = Cfg.Section("session").Key("PROVIDER").In("memory", SessionConfig.Provider = Cfg.Section("session").Key("PROVIDER").In("memory",
[]string{"memory", "file", "redis", "mysql"}) []string{"memory", "file", "redis", "mysql"})
SessionConfig.ProviderConfig = strings.Trim(Cfg.Section("session").Key("PROVIDER_CONFIG").String(), "\" ") SessionConfig.ProviderConfig = strings.Trim(Cfg.Section("session").Key("PROVIDER_CONFIG").String(), "\" ")
SessionConfig.CookieName = Cfg.Section("session").Key("COOKIE_NAME").MustString("i_like_gogits")
SessionConfig.CookieName = Cfg.Section("session").Key("COOKIE_NAME").MustString("i_like_gitea")
SessionConfig.CookiePath = AppSubURL SessionConfig.CookiePath = AppSubURL
SessionConfig.Secure = Cfg.Section("session").Key("COOKIE_SECURE").MustBool(false) SessionConfig.Secure = Cfg.Section("session").Key("COOKIE_SECURE").MustBool(false)
SessionConfig.Gclifetime = Cfg.Section("session").Key("GC_INTERVAL_TIME").MustInt64(86400) SessionConfig.Gclifetime = Cfg.Section("session").Key("GC_INTERVAL_TIME").MustInt64(86400)

Loading…
Cancel
Save