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
{{ message }}
Repository navigation
delete-data also deletes the persistent profile of any session whose name starts with <name>- #499
playwright-cli -s=work delete-data deletes the user data dir of session work-test too.
Session.deleteData() (cli-client/session.ts) removes every entry matching file.startsWith(`ud-${this.name}-`). User data dirs are named ud-${sessionName}-${browserToken}, so ud-work- is a prefix of ud-work-test-chrome.
Steps to reproduce
U=http://127.0.0.1:8765/ # any http originforsin work work-test;do
playwright-cli -s=$s open --persistent $U
playwright-cli -s=$s localstorage-set k data-of-$s
playwright-cli -s=$s close
done
ls ~/.cache/ms-playwright/daemon/*/ # ud-work-chrome ud-work-test-chrome
playwright-cli -s=work delete-data # Deleted user data for browser 'work'.
ls ~/.cache/ms-playwright/daemon/*/ # both ud-* dirs are gone
playwright-cli -s=work-test open --persistent $U
playwright-cli -s=work-test localstorage-get k
Expected
Only ud-work-* for session work is deleted; work-test still returns k=data-of-work-test (it does when delete-data is not run).
Actual
localStorage key 'k' not found — the profile of work-test (cookies, logins, storage) was deleted.
Suggested fix
Match the exact directory ud-${name}-${browserToken} (or store the user data dir path in the .session file and delete only that).
Hi, I'm the Playwright bot. I reproduced this on Linux.
Reproduced and fixed in the proposed patch on Linux, using tip-of-tree (1.66.0-next, base edeb0bd05176ff187c372c1e38e5d89a232bd5b3) in Chrome, Chromium, Firefox and WebKit. The directory lookup matches a session-name prefix, so deleting mysession also deletes mysession-test's profile. The fix matches the exact directory name using the session's recorded browser token.
playwright-cli -s=mysession-test open --persistent http://localhost:8919/hello-world
playwright-cli -s=mysession-test localstorage-set k data-of-mysession-test
playwright-cli -s=mysession-test close
playwright-cli -s=mysession open --persistent http://localhost:8919/hello-world
playwright-cli -s=mysession close
playwright-cli -s=mysession delete-data
playwright-cli -s=mysession-test open --persistent http://localhost:8919/hello-world
playwright-cli -s=mysession-test localstorage-get k
All four browser projects return localStorage key 'k' not found instead of the stored value. The existing delete-data named session test was extended to check this scenario.
With the fix, the same test preserves the second session's stored value and confirms that the target profile was deleted. All 232 checks in cli-session, cli-persistent, cli-isolated, cli-storage and cli-json pass across the four browser projects. npm run build and npm run flint pass.
Triaged on Linux by the Playwright bot - agent run
Activity
github-actions commentedon Nov 5, 2026
microsoft-playwright-automation commentedon Nov 5, 2026
Hi, I'm the Playwright bot. I reproduced this on Linux.
Reproduced and fixed in the proposed patch on Linux, using tip-of-tree (
1.66.0-next, baseedeb0bd05176ff187c372c1e38e5d89a232bd5b3) in Chrome, Chromium, Firefox and WebKit. The directory lookup matches a session-name prefix, so deletingmysessionalso deletesmysession-test's profile. The fix matches the exact directory name using the session's recorded browser token.Draft PR: microsoft/playwright#43928
Minimal repro and results
Using a local HTTP page:
All four browser projects return
localStorage key 'k' not foundinstead of the stored value. The existingdelete-data named sessiontest was extended to check this scenario.With the fix, the same test preserves the second session's stored value and confirms that the target profile was deleted. All 232 checks in
cli-session,cli-persistent,cli-isolated,cli-storageandcli-jsonpass across the four browser projects.npm run buildandnpm run flintpass.Triaged on Linux by the Playwright bot - agent run