From b01b95194ee3c25cbe9e915f1c188726ba2db7f2 Mon Sep 17 00:00:00 2001 From: Cqoicebordel Date: Mon, 19 Jan 2015 20:16:06 +0100 Subject: [PATCH] Allow non specific cookies --- searx/webapp.py | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/searx/webapp.py b/searx/webapp.py index 7c3eddee8..f04d9276a 100644 --- a/searx/webapp.py +++ b/searx/webapp.py @@ -470,6 +470,8 @@ def preferences(): lang = request.cookies['language'] blocked_engines = [] + + resp = make_response(redirect(url_for('index'))) if request.method == 'GET': blocked_engines = request.cookies.get('blocked_engines', '').split(',') @@ -502,8 +504,8 @@ def preferences(): blocked_engines.append(engine_name) elif pd_name == 'theme': theme = pd if pd in themes else default_theme - - resp = make_response(redirect(url_for('index'))) + else: + resp.set_cookie(pd_name, pd, max_age=cookie_max_age) user_blocked_engines = request.cookies.get('blocked_engines', '').split(',') # noqa @@ -555,6 +557,7 @@ def preferences(): autocomplete_backends=autocomplete_backends, shortcuts={y: x for x, y in engine_shortcuts.items()}, themes=themes, + cookies=request.cookies, theme=get_current_theme_name())