From 0c750084dc9fc3813207109d8a2e6cb9dce896c6 Mon Sep 17 00:00:00 2001 From: Benjamin Dykstra Date: Mon, 22 Jun 2015 22:43:12 +0000 Subject: [PATCH] [#2295] [WebUI] Increased lifespan of display settings Display settings for the WebUI are persisted using cookies created by Ex.state.CookieProvider. When no expiration date is provided, a default value of (now + 7 days) is used. This causes display settings to be lost frequently. This fix adds an 'expires' parameter with a value of (now + 10 years). This change does not affect the lifespan of the session cookie, which is created by a separate system. --- deluge/ui/web/js/deluge-all/Deluge.js | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/deluge/ui/web/js/deluge-all/Deluge.js b/deluge/ui/web/js/deluge-all/Deluge.js index 2d4e4ecdf..9401de210 100644 --- a/deluge/ui/web/js/deluge-all/Deluge.js +++ b/deluge/ui/web/js/deluge-all/Deluge.js @@ -31,7 +31,14 @@ */ // Setup the state manager -Ext.state.Manager.setProvider(new Ext.state.CookieProvider()); +Ext.state.Manager.setProvider(new Ext.state.CookieProvider({ + /** + * By default, cookies will expire after 7 days. Provide + * an expiry date 10 years in the future to approximate + * a cookie that does not expire. + */ + expires: new Date(new Date().getTime() + (1000 * 60 * 60 * 24 * 365 * 10)) +})); // Add some additional functions to ext and setup some of the // configurable parameters