diff --git a/searx/templates/search.html b/searx/templates/search.html index e084610ca..ab83d77ec 100644 --- a/searx/templates/search.html +++ b/searx/templates/search.html @@ -6,4 +6,5 @@ {{ category }}: {% endfor %}

+

remember categories:

diff --git a/searx/webapp.py b/searx/webapp.py index 51d910da2..9efb97ee5 100644 --- a/searx/webapp.py +++ b/searx/webapp.py @@ -80,12 +80,14 @@ def index(): selected_engines.extend(x.name for x in categories[ccateg]) query = request.form['q'].encode('utf-8') results = search(query, request, selected_engines) + remember_categs = True if 'save' in request.form else False if request.form.get('format') == 'json': # TODO HTTP headers return json.dumps({'query': query, 'results': results}) template = render('results.html', results=results, q=query.decode('utf-8'), selected_categories=selected_categories) resp = make_response(template) - resp.set_cookie('categories', ','.join(selected_categories)) + if remember_categs: + resp.set_cookie('categories', ','.join(selected_categories)) return resp return render('index.html')