Skip to content

cef: per-engine RequestContext cache_path ignored for cookies #158

@mxaddict

Description

@mxaddict

Problem

BrowserHost::new_with_options creates a per-engine `CefRequestContext` with a custom `cache_path` (`~/.local/share/buffr/engines//`). The context is created successfully — `is_global=0` confirmed via the log added in 9c367fa. We pass it to `browser_host_create_browser_sync` as the `request_context` parameter.

But cookies still flow to CEF's global `Default/` subdirectory under `root_cache_path`, not to the per-engine `cache_path`. `engines/cef/` stays empty even with active browsing.

Evidence

$ ls ~/.local/share/buffr-debug/engines/cef/
(empty)

$ ls ~/.local/share/buffr-debug/Default/
AutofillAiModelCache/  Cache/  Cookies  Code Cache/  Extension*/  ...

Log line proves per-engine context was constructed:

```
INFO buffr_cef::host: per-engine RequestContext created is_global=0
```

Impact

Low for now — only the CEF engine is shipped, so a single global cookie store is fine. Tab-level isolation works (each tab respects same-origin policy). Cross-tab cookie isolation between engine instances doesn't work.

Blocks multi-engine work where each instance wants its own cookie jar (e.g., `work` vs `personal` profiles in the same buffr).

Diagnosis directions

  • CEF 147 Alloy vs Chromium runtime may treat per-RequestContext storage differently
  • May need explicit `CefRequestContext::GetCookieManager(callback)` bootstrap to materialize the per-context cookie store
  • May need a `CefRequestContextHandler` impl
  • cef-rs binding might be missing a step in `browser_host_create_browser_sync` request_context propagation

Acceptance

  • With multiple engine instances configured, each writes cookies to its own `engines//` cache_path
  • `Default/` cookie store no longer accumulates per-engine state

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions