From d59b0f6ff7ee24d94eaa5ad68173405faea6a81c Mon Sep 17 00:00:00 2001 From: ᴜɴᴋɴᴡᴏɴ Date: Sat, 29 Feb 2020 00:26:03 +0800 Subject: conf: overhaul sessions settings (#5952) --- internal/cmd/web.go | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) (limited to 'internal/cmd') diff --git a/internal/cmd/web.go b/internal/cmd/web.go index 4cf1edac..728d5c80 100644 --- a/internal/cmd/web.go +++ b/internal/cmd/web.go @@ -142,10 +142,18 @@ func newMacaron() *macaron.Macaron { m.Use(captcha.Captchaer(captcha.Options{ SubURL: conf.Server.Subpath, })) - m.Use(session.Sessioner(conf.SessionConfig)) + m.Use(session.Sessioner(session.Options{ + Provider: conf.Session.Provider, + ProviderConfig: conf.Session.ProviderConfig, + CookieName: conf.Session.CookieName, + CookiePath: conf.Server.Subpath, + Gclifetime: conf.Session.GCInterval, + Maxlifetime: conf.Session.MaxLifeTime, + Secure: conf.Session.CookieSecure, + })) m.Use(csrf.Csrfer(csrf.Options{ Secret: conf.Security.SecretKey, - Cookie: conf.CSRFCookieName, + Cookie: conf.Session.CSRFCookieName, SetCookie: true, Header: "X-Csrf-Token", CookiePath: conf.Server.Subpath, -- cgit v1.2.3