summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorYorhel <git@yorhel.nl>2022-08-21 12:58:07 +0200
committerYorhel <git@yorhel.nl>2022-08-21 12:58:07 +0200
commit5eb3eaa7484ade5bfd4492af95de0a0d3dcc2c03 (patch)
tree4a0e98558081a1e37576b8eff3951b8fcca96bcb
parentdd840acc005eac6f07b35f56e04dff3d9f5cfe5e (diff)
Clear unused cookie & localStorage
-rw-r--r--elm/clear-storage.js3
-rwxr-xr-xutil/vndb.pl3
2 files changed, 6 insertions, 0 deletions
diff --git a/elm/clear-storage.js b/elm/clear-storage.js
new file mode 100644
index 00000000..db793820
--- /dev/null
+++ b/elm/clear-storage.js
@@ -0,0 +1,3 @@
+/* We used to use localStorage for some client-side preferences, no need to
+ * keep that data around now that that feature is gone. */
+if(window.localStorage) window.localStorage.clear();
diff --git a/util/vndb.pl b/util/vndb.pl
index 3c0be0c2..f68ddc40 100755
--- a/util/vndb.pl
+++ b/util/vndb.pl
@@ -51,6 +51,9 @@ TUWF::hook before => sub {
# Ought to be more reliable than checking the Referer header, but it's unfortunately a bit uglier.
tuwf->resCookie(samesite => 1, httponly => 1, samesite => 'Strict') if !VNWeb::Validation::samesite;
+ # Remove an old cookie that is no longer used
+ tuwf->resCookie(prodrelexpand => undef) if tuwf->reqCookie('prodrelexpand');
+
tuwf->req->{trace_start} = time if config->{trace_log};
};