-
QuestionThis is very weird and very serious issue i don't know why but global variable shows up across devices this is very weird and mysterious like it's beyond my understanding. To recreate the problem simply visit the website where the file is hosted home.pluge.repl.co and go to account page send email to a email id and simply enter the OTP reopen the website in other device or browser and reopen the account page and you will see welcome {email_id you provided} and this is ultra pro max weird thing like beyond my understanding the thing is the app code has lot of confidential info that's why i am not providing any code sample but if problem persists i will eventually provide it please look into it @FeodorFitsner @ndonkoHenri Code sampleNo response Error messageNo response ------------------------------------------------------
|
Beta Was this translation helpful? Give feedback.
Replies: 1 comment
-
the flet dosen't starts a new instance for every device that get's connected to the flet website due to which global variables get shared to solve this problem i simply created a database and started storing global variables in dictionary which is stored in .txt file using eval function and for variables i created global variables using unique id
|
Beta Was this translation helpful? Give feedback.
the flet dosen't starts a new instance for every device that get's connected to the flet website due to which global variables get shared to solve this problem i simply created a database and started storing global variables in dictionary which is stored in .txt file using eval function and for variables i created global variables using unique id
` def sb(key , value="pass", variable="pass"):
uinqueid=page.client_storage.get("user_unique_id")
if variable=="pass":
filename = "temp_user_data.txt"
with open(filename, "r+") as file:
# Get original data
original = eval(file.read())
# Seek to beginning
file.seek(0)
if value=="pass":
return original[uinqueid][key]
else:
file.truncate()
try:
orig…