cookie: MaxAge

and minor changes
This commit is contained in:
mhsanaei
2025-09-12 13:04:36 +02:00
parent 40b6d7707a
commit 311d11a3c1
2 changed files with 20 additions and 3 deletions

View File

@@ -2,6 +2,7 @@ package session
import (
"encoding/gob"
"net/http"
"x-ui/database/model"
@@ -32,6 +33,7 @@ func SetMaxAge(c *gin.Context, maxAge int) {
Path: defaultPath,
MaxAge: maxAge,
HttpOnly: true,
SameSite: http.SameSiteLaxMode,
})
}
@@ -61,5 +63,6 @@ func ClearSession(c *gin.Context) {
Path: defaultPath,
MaxAge: -1,
HttpOnly: true,
SameSite: http.SameSiteLaxMode,
})
}