From 04b6eb509c6b81b6fbe6f3acf7bfb4b7eaebe2de Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Fr=C3=A9d=C3=A9ric=20Guillot?= Date: Mon, 21 Jan 2019 20:26:46 -0800 Subject: [PATCH] Rename session cookies --- http/cookie/cookie.go | 4 ++-- ui/middleware.go | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/http/cookie/cookie.go b/http/cookie/cookie.go index 799d26ce..8874c412 100644 --- a/http/cookie/cookie.go +++ b/http/cookie/cookie.go @@ -11,8 +11,8 @@ import ( // Cookie names. const ( - CookieSessionID = "sessionID" - CookieUserSessionID = "userSessionID" + CookieAppSessionID = "MinifluxAppSessionID" + CookieUserSessionID = "MinifluxUserSessionID" // Cookie duration in days. cookieDuration = 30 diff --git a/ui/middleware.go b/ui/middleware.go index 81fb3a52..f53ac4e3 100644 --- a/ui/middleware.go +++ b/ui/middleware.go @@ -78,7 +78,7 @@ func (m *middleware) handleAppSession(next http.Handler) http.Handler { } } - http.SetCookie(w, cookie.New(cookie.CookieSessionID, session.ID, m.cfg.IsHTTPS, m.cfg.BasePath())) + http.SetCookie(w, cookie.New(cookie.CookieAppSessionID, session.ID, m.cfg.IsHTTPS, m.cfg.BasePath())) } else { logger.Debug("[UI:AppSession] %s", session) } @@ -108,7 +108,7 @@ func (m *middleware) handleAppSession(next http.Handler) http.Handler { } func (m *middleware) getAppSessionValueFromCookie(r *http.Request) *model.Session { - cookieValue := request.CookieValue(r, cookie.CookieSessionID) + cookieValue := request.CookieValue(r, cookie.CookieAppSessionID) if cookieValue == "" { return nil }