chromiumembedded / cef

Chromium Embedded Framework (CEF). A simple framework for embedding Chromium-based browsers in other applications.
https://bitbucket.org/chromiumembedded/cef/
Other
3.32k stars 465 forks source link

DeleteCookies should fail on invalid URL #3351

Open magreenblatt opened 2 years ago

magreenblatt commented 2 years ago

Original report by Andrew (Bitbucket: aimcosoftware, GitHub: aimcosoftware).


I’m trying to delete cookies for a specified domain. but it deletes all cookies, not just the specified domain.

I don’t have the full Url, only the domain from visiting the cookies. I’m using this from within CEFSharp.

GetGlobalCookieManager.DeleteCookies(".ebay.co.uk")

CEFSharp has an extension method to get all cookies, tried this to delete each cookie, but still deletes all.

For Each Item As Cookie In Await CookieManager.VisitAllCookiesAsync()
    If Item.Domain = MyDomain Then
        CookieManager().DeleteCookies(Item.Domain, Item.Name)
    End If
Next

It seems odd that this could be an unreported bug, so any help or pointers would be appreciated.

Thank you

magreenblatt commented 2 years ago

DeleteCookies requires a valid URL. ".ebay.co.uk" is not a valid URL so it’s being treated as empty (the method should probably fail instead). You should specify a valid URL, or use Visit methods to delete specific cookies. See the documentation.

magreenblatt commented 2 years ago

Original comment by Ahemod (Bitbucket: Ahemod).


I use CEF API to get access to DeleteCookies means CEF API is precisely needed for it, I checked this on a different page called “رام سامسونگ“ and it worked.

magreenblatt commented 2 years ago

Original changes by Andrew (Bitbucket: aimcosoftware, GitHub: aimcosoftware).


magreenblatt commented 2 years ago

Original changes by Andrew (Bitbucket: aimcosoftware, GitHub: aimcosoftware).


magreenblatt commented 2 years ago