fix: session max age (#392)

This commit is contained in:
boojack 2022-11-01 21:03:33 +08:00 committed by GitHub
parent 2a275b2875
commit 55dee0df7e
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -25,7 +25,7 @@ func setUserSession(ctx echo.Context, user *api.User) error {
sess, _ := session.Get("session", ctx)
sess.Options = &sessions.Options{
Path: "/",
MaxAge: 1000 * 3600 * 24 * 30,
MaxAge: 3600 * 24 * 30,
HttpOnly: true,
}
sess.Values[userIDContextKey] = user.ID