fix: only show and clear known cookies. closes #3763

This commit is contained in:
GenericMale 2024-12-29 21:49:07 +01:00
parent c1bb0bebd4
commit 30ea333246
2 changed files with 8 additions and 5 deletions

View file

@ -10,10 +10,12 @@
<th>{{ _('Value') }}</th>{{- '' -}} <th>{{ _('Value') }}</th>{{- '' -}}
</tr> </tr>
{%- for cookie in cookies -%} {%- for cookie in cookies -%}
<tr>{{- '' -}} {% if cookie in preferences.key_value_settings %}
<td>{{ cookie }}</td>{{- '' -}} <tr>{{- '' -}}
<td>{{ cookies[cookie] }}</td>{{- '' -}} <td>{{ cookie }}</td>{{- '' -}}
</tr> <td>{{ cookies[cookie] }}</td>{{- '' -}}
</tr>
{% endif %}
{%- endfor -%} {%- endfor -%}
</table> </table>
{%- else -%} {%- else -%}

View file

@ -1289,7 +1289,8 @@ def favicon():
def clear_cookies(): def clear_cookies():
resp = make_response(redirect(url_for('index', _external=True))) resp = make_response(redirect(url_for('index', _external=True)))
for cookie_name in request.cookies: for cookie_name in request.cookies:
resp.delete_cookie(cookie_name) if cookie_name in request.preferences.key_value_settings:
resp.delete_cookie(cookie_name)
return resp return resp