···2121 ProviderConfig string
2222 // Cookie name to save session ID. Default is "MacaronSession".
2323 CookieName string
2424- // Cookie path to store. Default is "/". HINT: there was a bug, the old value doesn't have trailing slash, and could be empty "".
2424+ // Cookie path to store. Default is "/".
2525 CookiePath string
2626 // GC interval time in seconds. Default is 3600.
2727 Gclifetime int64
···4949 SessionConfig.ProviderConfig = path.Join(AppWorkPath, SessionConfig.ProviderConfig)
5050 }
5151 SessionConfig.CookieName = sec.Key("COOKIE_NAME").MustString("i_like_gitea")
5252- SessionConfig.CookiePath = AppSubURL + "/" // there was a bug, old code only set CookePath=AppSubURL, no trailing slash
5252+ SessionConfig.CookiePath = AppSubURL
5353+ if SessionConfig.CookiePath == "" {
5454+ SessionConfig.CookiePath = "/"
5555+ }
5356 SessionConfig.Secure = sec.Key("COOKIE_SECURE").MustBool(strings.HasPrefix(strings.ToLower(AppURL), "https://"))
5457 SessionConfig.Gclifetime = sec.Key("GC_INTERVAL_TIME").MustInt64(86400)
5558 SessionConfig.Maxlifetime = sec.Key("SESSION_LIFE_TIME").MustInt64(86400)
+1
routers/common/middleware.go
···3838 })
3939 })
40404141+ // wrap the request and response, use the process context and add it to the process manager
4142 handlers = append(handlers, func(next http.Handler) http.Handler {
4243 return http.HandlerFunc(func(resp http.ResponseWriter, req *http.Request) {
4344 ctx, _, finished := process.GetManager().AddTypedContext(req.Context(), fmt.Sprintf("%s: %s", req.Method, req.RequestURI), process.RequestProcessType, true)