Commit 8f3752c4 by 1808837298@qq.com

feat: enhance session store security and configuration

- Add 30-day max age for session cookies
- Enable HttpOnly flag
- Set SameSite to strict mode
parent 94c10d8d
......@@ -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))
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or sign in to comment