diff --git a/config/version b/config/version index 05822b7e..f3ac133c 100644 --- a/config/version +++ b/config/version @@ -1 +1 @@ -2.8.11 \ No newline at end of file +2.9.0 \ No newline at end of file diff --git a/web/session/session.go b/web/session/session.go index 95b85227..9f7cedde 100644 --- a/web/session/session.go +++ b/web/session/session.go @@ -14,7 +14,6 @@ import ( const ( loginUserKey = "LOGIN_USER" - defaultPath = "/" ) func init() { @@ -59,8 +58,12 @@ func IsLogin(c *gin.Context) bool { func ClearSession(c *gin.Context) { s := sessions.Default(c) s.Clear() + cookiePath := c.GetString("base_path") + if cookiePath == "" { + cookiePath = "/" + } s.Options(sessions.Options{ - Path: defaultPath, + Path: cookiePath, MaxAge: -1, HttpOnly: true, SameSite: http.SameSiteLaxMode,