Alfakyn1
Alfakyn1

Reputation: 83

CefSharp VisitAllCookies always return no Cookies

I load a page in a CefSharp browser. I use my credentials to login, and then when logged in I try to visitallcookies but I always have 0.

I tried both visitallcookies() and visitallcookiesasync(). Both does the same. I'm trying to log in to google.com

chromeBrowser.Load("http://google.com");

private async void button1_Click(object sender, EventArgs e)
    {
        CookieVisitor _cookieVisitor = new CookieVisitor();

        var result = await Cef.GetGlobalCookieManager().VisitAllCookiesAsync();
        Console.WriteLine(result.Count.ToString());
    }

Thanks.

Upvotes: 0

Views: 2726

Answers (1)

xyzch
xyzch

Reputation: 26

I've added the code to the chromeBrowser.FrameLoadEnd method to solve this problem, and maybe you can try it.

{
...
chrome.FrameLoadEnd+=getCookie;
....
}

public async void getCookie{
your code
}

Upvotes: 1

Related Questions