Rename session cookies
This commit is contained in:
parent
7897d8a8ad
commit
04b6eb509c
2 changed files with 4 additions and 4 deletions
|
@ -11,8 +11,8 @@ import (
|
|||
|
||||
// Cookie names.
|
||||
const (
|
||||
CookieSessionID = "sessionID"
|
||||
CookieUserSessionID = "userSessionID"
|
||||
CookieAppSessionID = "MinifluxAppSessionID"
|
||||
CookieUserSessionID = "MinifluxUserSessionID"
|
||||
|
||||
// Cookie duration in days.
|
||||
cookieDuration = 30
|
||||
|
|
|
@ -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
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue