mirror of
https://github.com/grafana/grafana.git
synced 2025-08-02 22:49:25 +08:00
Backend: Do not set SameSite cookie attribute if cookie_samesite is none (#18462)
* Do not set SameSite login_error cookie attribute if cookie_samesite is none * Do not set SameSite grafana_session cookie attribute if cookie_samesite is none * Update middleware tests
This commit is contained in:

committed by
GitHub

parent
b6ec06eeb4
commit
4e29357d15
@ -256,7 +256,9 @@ func WriteSessionCookie(ctx *models.ReqContext, value string, maxLifetimeDays in
|
||||
Path: setting.AppSubUrl + "/",
|
||||
Secure: setting.CookieSecure,
|
||||
MaxAge: maxAge,
|
||||
SameSite: setting.CookieSameSite,
|
||||
}
|
||||
if setting.CookieSameSite != http.SameSiteDefaultMode {
|
||||
cookie.SameSite = setting.CookieSameSite
|
||||
}
|
||||
|
||||
http.SetCookie(ctx.Resp, &cookie)
|
||||
|
Reference in New Issue
Block a user