mirror of
https://github.com/KoboldAI/KoboldAI-Client.git
synced 2025-06-05 21:59:24 +02:00
Cookie Fix
This commit is contained in:
@@ -7694,9 +7694,12 @@ def UI_2_theme_list_refresh(data):
|
|||||||
#==================================================================#
|
#==================================================================#
|
||||||
@socketio.on('save_cookies')
|
@socketio.on('save_cookies')
|
||||||
def UI_2_save_cookies(data):
|
def UI_2_save_cookies(data):
|
||||||
|
print("Adding: {}".format(data))
|
||||||
|
print("to: {}".format(koboldai_vars.cookies))
|
||||||
for key in data:
|
for key in data:
|
||||||
#Note this won't sync to the client automatically as we're modifying a variable rather than setting it
|
#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]
|
koboldai_vars.cookies[key] = data[key]
|
||||||
|
print("Updated: {}".format(koboldai_vars.cookies))
|
||||||
with open("./settings/cookies.settings", "w") as f:
|
with open("./settings/cookies.settings", "w") as f:
|
||||||
f.write(json.dumps(koboldai_vars.cookies))
|
f.write(json.dumps(koboldai_vars.cookies))
|
||||||
|
|
||||||
|
@@ -3097,7 +3097,7 @@ function setCookie(cname, cvalue, exdays=60) {
|
|||||||
d.setTime(d.getTime() + (exdays * 24 * 60 * 60 * 1000));
|
d.setTime(d.getTime() + (exdays * 24 * 60 * 60 * 1000));
|
||||||
let expires = "expires="+d.toUTCString();
|
let expires = "expires="+d.toUTCString();
|
||||||
if (document.getElementById("on_colab").textContent == "true") {
|
if (document.getElementById("on_colab").textContent == "true") {
|
||||||
socket.emit("save_cookies", {cname: cvavlue});
|
socket.emit("save_cookies", {[cname]: cvalue});
|
||||||
}
|
}
|
||||||
document.cookie = cname + "=" + cvalue + ";" + expires + ";";
|
document.cookie = cname + "=" + cvalue + ";" + expires + ";";
|
||||||
}
|
}
|
||||||
|
Reference in New Issue
Block a user