-
-
Notifications
You must be signed in to change notification settings - Fork 616
Open
Description
Bug Report: clear_cookies() prevents future cookie persistence in storage_path
Description
After calling window.clear_cookies() or expiring a cookie via a server-side logout, the webview engine appears to stop persisting cookies to the defined storage_path. Even if the user logs back in successfully, cookies are no longer written to disk and are lost upon application restart.
Environment Details
- OS: Windows 7
- pywebview Version: 5.0
- Python Version: 3.7
- Renderer: Default for Win7
Steps to Reproduce
- Initialize
webview.start(storage_path='PATH_TO_DIR', private_mode=False). - Log in to the application (Cookie is successfully stored and persists across restarts).
- Trigger a logout that performs two actions:
- Server-side:
Set-Cookieheader with an expired date. - Client-side (Python):
window.clear_cookies().
- Server-side:
- Log back into the application.
- Close the application and restart.
Observed Behavior
- After the "clear" event, the cookie jar seems to "lock."
- Subsequent cookies generated during the session are visible in DevTools in a normal browser client but are not written to the
storage_path. - On restart, the user is unauthenticated because the
storage_pathwas not updated.
Expected Behavior
clear_cookies() should empty the current session and disk storage, but allow the engine to continue writing new cookies to the storage_path for the remainder of the session.
Additional Context
It appears the webview engine stops syncing the in-memory cookie jar to the persistent storage once a manual clear command is issued. This was tested with private_mode=False.
Metadata
Metadata
Assignees
Labels
No labels