Skip to content

[Linux] Snapmaker account login is lost after every restart because WebKit cookies are not persisted #984

Open

Description

@moberli

Is there an existing issue for this problem?

  • I have searched the existing issues

Snapmaker_Orca Version

2.4.0

Operating System (OS)

Linux

OS Version

Debian 13 (GNOME/X11)

Additional system information

· OS: Debian GNU/Linux 13, x86_64
· Desktop: GNOME on X11
· Snapmaker Orca: 2.4.0, build 01.10.01.50
· Orca Web: 2.3.38, build 20260915154633
· Packages tested: official x86_64 Flatpak and Ubuntu 24.04 AppImage
· Printer: Snapmaker U1

Printer

Snapmaker U1

How to reproduce

  1. Start Snapmaker Orca on Linux.
  2. Select Login/Register.
  3. Request and enter the email verification code.
  4. Confirm that the account and U1 printer are available.
  5. Close Snapmaker Orca normally.
  6. Start Snapmaker Orca again.

Actual results

Snapmaker Orca shows Login/Register and requires another email verification code.
The WebKit local-storage database initially contains these entries after a successful login:
· flutter.orca_user_info
· flutter.lava_user_info
They are committed successfully when the application closes. On the next start, however, the embedded authentication web view reports the user as offline. Snapmaker Orca then removes both entries and emits a web logout event.
No persistent WebKit cookie database is created for the Snapmaker authentication web view. Only local-storage and HSTS databases are present.

Expected results

The Snapmaker account session should remain valid after closing and reopening the application.

Project file & Debug log uploads

WebKitGTK uses an in-memory cookie store unless persistent storage is explicitly configured. Enabling SQLite cookie persistence on the web view's shared WebKitWebContext fixes the problem. After applying this at runtime, a cookies.sqlite database is created and the login survives application restarts.
The runtime proof of concept intercepted WebKit web-view creation and called:
auto* context = webkit_web_view_get_context(web_view);
auto* cookie_manager = webkit_web_context_get_cookie_manager(context);
webkit_cookie_manager_set_persistent_storage(
cookie_manager,
cookie_database_path.c_str(),
WEBKIT_COOKIE_PERSISTENT_STORAGE_SQLITE
);

This is only a diagnostic workaround. The proper fix should be implemented directly in Snapmaker Orca before the authentication web view is loaded.

Checklist of files to include

  • Log file
  • Project file

Anything else?

Root cause / confirmed workaround
WebKitGTK uses an in-memory cookie store unless persistent storage is explicitly configured. Enabling SQLite cookie persistence on the web view's shared WebKitWebContext fixes the problem. After applying this at runtime, a cookies.sqlite database is created and the login survives application restarts.
The runtime proof of concept intercepted WebKit web-view creation and called:
auto* context = webkit_web_view_get_context(web_view);
auto* cookie_manager = webkit_web_context_get_cookie_manager(context);
webkit_cookie_manager_set_persistent_storage(
cookie_manager,
cookie_database_path.c_str(),
WEBKIT_COOKIE_PERSISTENT_STORAGE_SQLITE
);

This is only a diagnostic workaround. The proper fix should be implemented directly in Snapmaker Orca before the authentication web view is loaded.
Suggested fix
On Linux, configure persistent cookie storage for the WebKit context used by the Snapmaker Home/Device/authentication web views. The database should be stored below the application's normal per-user data directory, with user-only permissions.
The upstream OrcaSlicer project already uses the same approach for PrinterWebView:
#ifdef linux
auto cookies_path = boost::filesystem::path(data_dir() + "/cache/cookies.db");
auto* web_view = static_cast<WebKitWebView*>(browser->GetNativeBackend());
auto* context = webkit_web_view_get_context(web_view);
auto* cookie_manager = webkit_web_context_get_cookie_manager(context);
webkit_cookie_manager_set_persistent_storage(
cookie_manager,
cookies_path.c_str(),
WEBKIT_COOKIE_PERSISTENT_STORAGE_SQLITE
);
#endif

Please apply equivalent handling to the Snapmaker authentication web view, not only to printer web views.
Additional Linux issue found during diagnosis
The bundled Flutter web application passes every entry from navigator.languages directly to Intl.Locale. WebKitGTK may return POSIX-style values such as en_US or C, causing:
Load failed: Engine init failed: Invalid argument(s): invalid language tag

Normalizing _ to - and falling back to a valid tag such as en-US prevents this failure. This may deserve a separate fix.

Activity

  1. added
    bug
    on Oct 9, 2026
  2. MilesRdz commented on Oct 23, 2026

    @MilesRdz

    Looks like this is fixed in the latest 2.4.1 alpha release.

  3. creat3dworld commented on Nov 14, 2026

    @creat3dworld

    Root cause confirmed: this fork has no webkit_cookie_manager_set_persistent_storage call anywhere — WebKitGTK uses an in-memory cookie store unless persistent storage is explicitly configured, so the login is lost on every restart.

    Fix: the shared web-view factory now enables SQLite persistent cookie storage at data_dir()/cache/cookies.db (same path upstream uses), for every web view the app creates. Real verification: log in, close the app, reopen, and confirm the session is still valid.

    PR: #1205

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    bug

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions