From f858d490d6474cb974e54d2d606a0c77d3aa6b80 Mon Sep 17 00:00:00 2001 From: Robert Court Date: Thu, 24 Sep 2026 10:23:53 +0100 Subject: [PATCH] Only store the NBLAST link cookie when the user agrees The upload dialog asks for consent to keep the query link in a cookie, but set it whether or not the box was ticked. It now sets it only when ticked, and the Learn More link points at VFB's own cookies page, which lists it, rather than Wikipedia. --- components/configuration/VFBUploader/configuration.json | 2 +- components/interface/VFBUploader/VFBUploader.js | 9 ++++++++- 2 files changed, 9 insertions(+), 2 deletions(-) diff --git a/components/configuration/VFBUploader/configuration.json b/components/configuration/VFBUploader/configuration.json index a606e86c8..98dce6171 100644 --- a/components/configuration/VFBUploader/configuration.json +++ b/components/configuration/VFBUploader/configuration.json @@ -7,7 +7,7 @@ "maxFileSize" : 5242880, "queryType": "SimilarMorphologyToUserData", "cookieStorageDays" : 100, - "cookiesLearnLink" : "https://en.wikipedia.org/wiki/HTTP_cookie", + "cookiesLearnLink" : "https://virtualflybrain.org/about/cookies/#functional-cookies", "text" : { "dialogTitle" : "Upload Data File", "dialogSubtitle" : "Generate a nblast query from your own data.", diff --git a/components/interface/VFBUploader/VFBUploader.js b/components/interface/VFBUploader/VFBUploader.js index 17a2b23ab..12a2e0238 100644 --- a/components/interface/VFBUploader/VFBUploader.js +++ b/components/interface/VFBUploader/VFBUploader.js @@ -94,7 +94,14 @@ class VFBUploader extends React.Component { let newURL = window.location.origin + window.location.pathname + "?id=" + _id + "&q=" + _id + "," + this.configuration.queryType; this.setState({ fileNBLASTURL: newURL, uploading : true }); - window.setCookie(_id, newURL, this.configuration.cookieStorageDays); + /* + * Only remember the link if the user ticked the cookie box -- the dialog + * asks for consent, so storing it regardless made the checkbox decorative. + * The link is still shown to copy either way. + */ + if (this.state.cookies) { + window.setCookie(_id, newURL, this.configuration.cookieStorageDays); + } axios.put(url, formData, { headers: { 'Content-Type': this.configuration.contentType } }