Explicitly set path on auth cookie

https://dev.discourse.org/t/15317
This commit is contained in:
Matt Palmer 2019-08-13 11:52:26 +10:00
parent f0bbe5bd1e
commit f81d3bb030
1 changed files with 1 additions and 1 deletions

View File

@ -216,7 +216,7 @@ func redirectIfNoCookie(handler http.Handler, r *http.Request, w http.ResponseWr
expiration := time.Now().Add(365 * 24 * time.Hour) expiration := time.Now().Add(365 * 24 * time.Hour)
cookieData := strings.Join([]string{username[0], strings.Join(groupsArray, "|")}, ",") cookieData := strings.Join([]string{username[0], strings.Join(groupsArray, "|")}, ",")
cookie := http.Cookie{Name: "__discourse_proxy", Value: signCookie(cookieData, config.CookieSecret), Expires: expiration, HttpOnly: true} cookie := http.Cookie{Name: "__discourse_proxy", Value: signCookie(cookieData, config.CookieSecret), Expires: expiration, HttpOnly: true, Path: "/"}
http.SetCookie(w, &cookie) http.SetCookie(w, &cookie)
// works around weird safari stuff // works around weird safari stuff