Skip to content

Database governance built for humans and agents — controlling changes and access across every major database.

Set session cookie as secure

天舟83052d20490c
diff --git a/server/jwt.go b/server/jwt.go
index 0a75f0acbc..53a61aab4a 100644
--- a/server/jwt.go
+++ b/server/jwt.go
@@ -125,7 +125,7 @@ func setTokenCookie(c echo.Context, name, token string, expiration time.Time) {
cookie.Path = "/"
// Http-only helps mitigate the risk of client side script accessing the protected cookie.
cookie.HttpOnly = true
-
+ cookie.Secure = true
c.SetCookie(cookie)
}
@@ -135,7 +135,7 @@ func removeTokenCookie(c echo.Context, name string) {
cookie.Value = ""
cookie.Expires = time.Unix(0, 0)
cookie.Path = "/"
-
+ cookie.Secure = true
c.SetCookie(cookie)
}
@@ -146,6 +146,7 @@ func setUserCookie(c echo.Context, user *api.Principal, expiration time.Time) {
cookie.Value = strconv.Itoa(user.ID)
cookie.Expires = expiration
cookie.Path = "/"
+ cookie.Secure = true
c.SetCookie(cookie)
}