Commit 6a9c0fd2 by 1808837298@qq.com

feat: configure session store options for API routes

- Set session cookie path to "/api"
- Disable secure flag for local development
- Enable HttpOnly flag for improved security
parent 14399d61
......@@ -145,6 +145,11 @@ func main() {
middleware.SetUpLogger(server)
// Initialize session store
store := cookie.NewStore([]byte(common.SessionSecret))
store.Options(sessions.Options{
Path: "/api",
Secure: false,
HttpOnly: true,
})
server.Use(sessions.Sessions("session", store))
router.SetRouter(server, buildFS, indexPage)
......
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