-
Questioni used client storage it worked as expected until i changed view=ft.WEB_BROWSER the browser in which i tested was firefox. Code sampleimport flet as ft
def main(page: ft.Page):
str_=page.client_storage.get("icanhackyou")
print(str_)
page.client_storage.set("icanhackyou","hello world")
print(page.client_storage.contains_key("icanhackyou"))
str_=page.client_storage.get("icanhackyou")
print(str_)
ft.app(target=main, assets_dir="assets", view=ft.WEB_BROWSER)
#use dropdown instead Error messageNo response ------------------------------------------------------
|
Beta Was this translation helpful? Give feedback.
Replies: 2 comments
-
i think this i a bug and i am going to raise an issue |
Beta Was this translation helpful? Give feedback.
-
The same origin policy for local storage ties the data to the protocol + hostname + port. So even though it's the same code/domain, using a different port would be treated as a separate "origin" by the browser. When re-running flet app it simply ran on a new port each time i re-ran it the port number and due to local storage protocol hostname and port should be same due to which i got the unexpected behaviour. |
Beta Was this translation helpful? Give feedback.
The same origin policy for local storage ties the data to the protocol + hostname + port. So even though it's the same code/domain, using a different port would be treated as a separate "origin" by the browser. When re-running flet app it simply ran on a new port each time i re-ran it the port number and due to local storage protocol hostname and port should be same due to which i got the unexpected behaviour.