OrcaSlicer icon indicating copy to clipboard operation
OrcaSlicer copied to clipboard

Linux: account session not persisted — logged out on every restart (WebKitGTK cookie storage never set)

Open leomarostegam opened this issue 3 months ago • 1 comments

Bug

On Linux (flatpak v2.3.5, io.github.Snapmaker.Snapmaker_Orca), logging into a Snapmaker account works, but after closing and reopening the app the user is always logged out again.

Root cause

The login lives in the embedded WebKitGTK webview session (id.snapmaker.com). On Linux, WebKitGTK keeps cookies in memory only unless the app explicitly calls webkit_cookie_manager_set_persistent_storage(). Snapmaker Orca never does, so the session cookie dies with the process. Evidence: there is no cookies.sqlite anywhere under ~/.var/app/io.github.Snapmaker.Snapmaker_Orca/data/snapmaker-orca/, and on startup the log immediately shows web logout event received / user offline. On Windows (WebView2) cookie persistence is automatic, which is why this only affects Linux.

Verified fix

I confirmed the diagnosis with an LD_PRELOAD shim that interposes webkit_web_view_new / webkit_web_context_get_default and, on the default context, calls:

webkit_cookie_manager_set_persistent_storage(mgr,
    "<data_dir>/cookies.sqlite", WEBKIT_COOKIE_PERSISTENT_STORAGE_SQLITE);

With that in place, cookies.sqlite is created and the login survives restarts. The proper fix is to make the same call in the app's Linux webview setup (e.g. where the wxWebView/WebKit backend is initialized).

Environment

  • Snapmaker Orca 2.3.5, flatpak (GNOME 49 runtime, webkit2gtk-4.1)
  • Ubuntu 24.04, X11

leomarostegam avatar Aug 14 '26 06:08 leomarostegam

Fixed in v2.4.1 — see "Fixed an issue where Linux users' login status could not be saved" in the v2.4.1 release notes. Please test on v2.4.1 and comment/reopen if it still reproduces on your setup.

zhangzhend0ng avatar Nov 03 '26 16:11 zhangzhend0ng