Disclosure Statement: This site contains affiliate links, which means that I may receive a commission if you make a purchase using these links. As an eBay Partner, I earn from qualifying purchases.

Cef4 cookies

Post Reply
User avatar
salvadordf
Posts: 4016
Joined: Thu Feb 02, 2017 12:24 pm
Location: Spain
Contact:

Re: Cef4 cookies

Post by salvadordf »

Hi,

The CookieVisitor demo shows how to visit, create and delete cookies.

CEF4Delphi uses the SetStoragePath function too to set the new path to store the cookies :
https://github.com/salvadordf/CEF4Delph ... .pas#L1213

I've never tried to change the cookie's path of an existing browser. I don't know if the current CEF binaries support that feature but you can always create a new child browser with a different context and a different path for the cookies.

The MDIBrowser demo has the code to create child browsers with different contexts. All you need is to set a different path for the cache and cookies here :
https://github.com/salvadordf/CEF4Delph ... m.pas#L211

The cache path is the 1st parameter in TCefRequestContextRef.New, and the cookies path is the 4th parameter in Chromium1.CreateBrowser.
Post Reply