mirror of
https://github.com/QuantumNous/new-api.git
synced 2026-12-06 00:03:11 +00:00
feat: enhance session store security and configuration
- Add 30-day max age for session cookies - Enable HttpOnly flag - Set SameSite to strict mode
This commit is contained in:
1 parent
bbc1550a9e
commit
cb4d40c3c8
1 file changed
+5
-2
@@ -146,8 +146,11 @@ func main() {
|
||||
// Initialize session store
|
||||
store := cookie.NewStore([]byte(common.SessionSecret))
|
||||
store.Options(sessions.Options{
|
||||
Path: "/",
|
||||
Secure: false,
|
||||
Path: "/",
|
||||
MaxAge: 2592000, // 30 days
|
||||
HttpOnly: true,
|
||||
Secure: false,
|
||||
SameSite: http.SameSiteStrictMode,
|
||||
})
|
||||
server.Use(sessions.Sessions("session", store))
|
||||
|
||||
|
||||
Reference in new issue
Block a user