From 2102f9d92db308f694707ebe6253beb20c5f7505 Mon Sep 17 00:00:00 2001 From: Tamal Saha Date: Fri, 12 Jul 2019 06:57:31 -0700 Subject: Support setting cookie domain (#6288) Signed-off-by: Tamal Saha --- routers/routes/routes.go | 16 +++++++++------- 1 file changed, 9 insertions(+), 7 deletions(-) (limited to 'routers/routes/routes.go') diff --git a/routers/routes/routes.go b/routers/routes/routes.go index ec57e8f5fd..c81d56064c 100644 --- a/routers/routes/routes.go +++ b/routers/routes/routes.go @@ -181,12 +181,13 @@ func NewMacaron() *macaron.Macaron { } m.Use(i18n.I18n(i18n.Options{ - SubURL: setting.AppSubURL, - Files: localFiles, - Langs: setting.Langs, - Names: setting.Names, - DefaultLang: "en-US", - Redirect: false, + SubURL: setting.AppSubURL, + Files: localFiles, + Langs: setting.Langs, + Names: setting.Names, + DefaultLang: "en-US", + Redirect: false, + CookieDomain: setting.SessionConfig.Domain, })) m.Use(cache.Cacher(cache.Options{ Adapter: setting.CacheService.Adapter, @@ -202,8 +203,9 @@ func NewMacaron() *macaron.Macaron { Cookie: setting.CSRFCookieName, SetCookie: true, Secure: setting.SessionConfig.Secure, - CookieHttpOnly: true, + CookieHttpOnly: setting.CSRFCookieHTTPOnly, Header: "X-Csrf-Token", + CookieDomain: setting.SessionConfig.Domain, CookiePath: setting.AppSubURL, })) m.Use(toolbox.Toolboxer(m, toolbox.Options{ -- cgit v1.2.3