Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

How to persist cookies? #194

Open
mpulukkinen opened this issue Nov 29, 2024 · 1 comment
Open

How to persist cookies? #194

mpulukkinen opened this issue Nov 29, 2024 · 1 comment

Comments

@mpulukkinen
Copy link

I've tried several things, adding the paths to global settings in init, also adding the cache paths with CefRequestContext, tried calling the shutdown for the CefRuntime but nothing helps. The sample avalonia app does not persist cookies either, so user would have to click on any cookie consents, inclusing the default url for google, every time the browser is used...

@sakya
Copy link

sakya commented Nov 29, 2024

For we it works using the ContextFaxtory when creating the browser and setting CachePath to the same value of the global settings

_browser = new AvaloniaCefBrowser(ContextFactory);
    private CefRequestContext ContextFactory()
    {
        CefRequestContextSettings settings = new();
        if (!IsIncognito) {
            settings.CachePath = Settings.Instance.BrowserCachePath;
        }
        var context = CefRequestContext.CreateContext(
            settings,
            new RequestContextHandler()
        );
        return context;
    }

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants