From 03b3636d7460633204ee85b0cba13e8b242b8fd2 Mon Sep 17 00:00:00 2001 From: JustSong Date: Sun, 10 Nov 2024 12:56:06 +0800 Subject: [PATCH] fix: fix cookie path --- main.go | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/main.go b/main.go index bca05ac..f6f24f4 100644 --- a/main.go +++ b/main.go @@ -65,11 +65,11 @@ func main() { } else { store = cookie.NewStore([]byte(common.SessionSecret)) } - //store.Options(sessions.Options{ - // Path: "/", - // HttpOnly: true, - // MaxAge: 30 * 24 * 3600, - //}) + store.Options(sessions.Options{ + Path: "/", + HttpOnly: true, + MaxAge: 30 * 24 * 3600, + }) server.Use(sessions.Sessions("session", store)) router.SetRouter(server, buildFS, indexPage)