You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I have searched the opened issues and there are no duplicates
Describe the bug
When running a Flet app in web mode (ft.AppView.WEB_BROWSER), opening the same URL in multiple browser tabs causes cross-tab session interference. Specifically:
Open Tab1 at http://127.0.0.1:6006 — the app works correctly.
Open Tab2 at the same URL (via "Duplicate Tab", Ctrl+clicking the address bar and pressing Enter, or other methods that cause sessionStorage inheritance).
Go back to Tab1 and click any button — Tab1's UI does not update, but Tab2's UI changes instead.
The root cause is that the server-side session reuse logic in flet_app.py does not check whether the existing session's connection is still alive before handing it to a new WebSocket connection.
When a second browser tab inherits the same _flet_session_id from window.sessionStorage (which is standard HTML5 behavior for duplicated tabs), the server blindly reuses the existing Session object and calls attach_connection(), which overwritesSession.__conn to point to Tab2's FletApp. After that, all UI patches — including those triggered by Tab1's events — are sent exclusively to Tab2.
Duplicate Check
Describe the bug
When running a Flet app in web mode (
ft.AppView.WEB_BROWSER), opening the same URL in multiple browser tabs causes cross-tab session interference. Specifically:http://127.0.0.1:6006— the app works correctly.sessionStorageinheritance).The root cause is that the server-side session reuse logic in
flet_app.pydoes not check whether the existing session's connection is still alive before handing it to a new WebSocket connection.When a second browser tab inherits the same
_flet_session_idfromwindow.sessionStorage(which is standard HTML5 behavior for duplicated tabs), the server blindly reuses the existingSessionobject and callsattach_connection(), which overwritesSession.__connto point to Tab2'sFletApp. After that, all UI patches — including those triggered by Tab1's events — are sent exclusively to Tab2.Code sample
Code
To reproduce
python demo.pyhttp://127.0.0.1:6006(Tab1). Click+/-buttons — works fine.sessionStorageto be inherited).+or-.Expected behavior
Each browser tab should have an independent session. Clicking buttons in Tab1 should only affect Tab1's UI, and Tab2 should be completely isolated.
Screenshots / Videos
Captures
_2026_05_21_14_35_48_538.mp4
Operating System
Windows
Operating system details
include Linux 、Mac
Flet version
0.85.1
Regression
I'm not sure / I don't know
Suggestions
No response
Logs
Logs
[Paste your logs here]Additional details
No response