【发布时间】:2021-11-30 08:34:38
【问题描述】:
我正在使用 grafana HTTP API 在 grafana 上构建前端应用程序。
用户身份验证使用基本身份验证模型(默认 grafana 身份验证)。我需要注销 API,这会导致 grafana_session cookie 过期。
我无法从我的脚本中删除 grafana_session cookie,因为 httpOnly 标志已打开。你能帮我处理用户注销吗?
我更改的唯一 grafana 配置是以下两个配置:
# set cookie SameSite attribute. defaults to `lax`. can be set to "lax", "strict", "none" and "disabled"
cookie_samesite = none
# set to true if you want to allow browsers to render Grafana in a <frame>, <iframe>, <embed> or <object>. d$
allow_embedding = true
【问题讨论】:
-
Cookie 是用于 UI 身份验证的,因此拥有用于 UI 注销的 API 没有意义。
-
那么如何从脚本中删除 HttpOnly cookie?
标签: cookies grafana setcookie httpcookie grafana-api