fix: update session store configuration
Some checks failed
Publish Docker image (amd64) / Push Docker image to multiple registries (push) Has been cancelled
Publish Docker image (arm64) / Push Docker image to multiple registries (push) Has been cancelled
Linux Release / release (push) Has been cancelled
macOS Release / release (push) Has been cancelled
Windows Release / release (push) Has been cancelled

- Change session cookie path from "/api" to "/"
- Remove HttpOnly flag
This commit is contained in:
1808837298@qq.com 2025-02-11 15:53:15 +08:00
parent 6a9c0fd2c0
commit 94c10d8def

View File

@ -146,9 +146,8 @@ func main() {
// Initialize session store
store := cookie.NewStore([]byte(common.SessionSecret))
store.Options(sessions.Options{
Path: "/api",
Secure: false,
HttpOnly: true,
Path: "/",
Secure: false,
})
server.Use(sessions.Sessions("session", store))