From eb0f59bdfbf12cb7da6aee47c0d53b3b628b431b Mon Sep 17 00:00:00 2001 From: ebolam Date: Thu, 8 Sep 2022 18:00:57 -0400 Subject: [PATCH] Cookie Fix --- aiserver.py | 3 +++ static/koboldai.js | 2 +- 2 files changed, 4 insertions(+), 1 deletion(-) diff --git a/aiserver.py b/aiserver.py index 50bad101..bfc03647 100644 --- a/aiserver.py +++ b/aiserver.py @@ -7694,9 +7694,12 @@ def UI_2_theme_list_refresh(data): #==================================================================# @socketio.on('save_cookies') def UI_2_save_cookies(data): + print("Adding: {}".format(data)) + print("to: {}".format(koboldai_vars.cookies)) for key in data: #Note this won't sync to the client automatically as we're modifying a variable rather than setting it koboldai_vars.cookies[key] = data[key] + print("Updated: {}".format(koboldai_vars.cookies)) with open("./settings/cookies.settings", "w") as f: f.write(json.dumps(koboldai_vars.cookies)) diff --git a/static/koboldai.js b/static/koboldai.js index 20aaddf3..547b5155 100644 --- a/static/koboldai.js +++ b/static/koboldai.js @@ -3097,7 +3097,7 @@ function setCookie(cname, cvalue, exdays=60) { d.setTime(d.getTime() + (exdays * 24 * 60 * 60 * 1000)); let expires = "expires="+d.toUTCString(); if (document.getElementById("on_colab").textContent == "true") { - socket.emit("save_cookies", {cname: cvavlue}); + socket.emit("save_cookies", {[cname]: cvalue}); } document.cookie = cname + "=" + cvalue + ";" + expires + ";"; }