zacharya19 commented on a change in pull request #6489: [AIRFLOW-3959] [AIRFLOW-4026] Add filter by DAG tags URL: https://github.com/apache/airflow/pull/6489#discussion_r347089529
########## File path: airflow/www/views.py ########## @@ -156,12 +158,19 @@ class AirflowBaseView(BaseView): } def render_template(self, *args, **kwargs): - return super().render_template( + templ = super().render_template( *args, # Cache this at most once per request, not for the lifetime of the view instance scheduler_job=lazy_object_proxy.Proxy(jobs.SchedulerJob.most_recent_job), **kwargs ) + resp = make_response(templ) + for k, v in kwargs.get('cookies', {}).items(): + if v: + resp.set_cookie(k, v, expires=2147483647) Review comment: I'm trying to save the users filters as long as possible (for example, if I work on the dags of team A, this is all I want to see, and I don't want to change the filters every day), so the magic number is max int. I can use flask session but flask session doesn't support setting expiration per cookie, only a global setting (`permanent_session_lifetime`) and I don't think it's best practice. ---------------------------------------------------------------- This is an automated message from the Apache Git Service. To respond to the message, please log on to GitHub and use the URL above to go to the specific comment. For queries about this service, please contact Infrastructure at: us...@infra.apache.org With regards, Apache Git Services