Page 1 of 1
Re: Simple Cookie DCEF4
Posted: Sun Apr 08, 2018 9:11 pm
by salvadordf
Hi,
Use the CookieVisitor demo and modify the CookieVisitorProc procedure to save your cookie.
Re: Simple Cookie DCEF4
Posted: Wed Oct 03, 2018 7:57 pm
by danicarla2
Hi guys
Im able to create the cookies, but when I close the application it erases all the cookies...
How do I leave them stored?
I used the MiniBrowser demo.. but this also happens with CookieVisitor
Re: Simple Cookie DCEF4
Posted: Wed Oct 03, 2018 8:28 pm
by salvadordf
Set the GlobalCEFApp.cache property with a writable directory before the GlobalCEFApp.StartMainProcess call in the DPR file.
Re: Simple Cookie DCEF4
Posted: Thu Oct 04, 2018 1:47 pm
by danicarla2
In DPR file says "GlobalCEFApp.GlobalContext Initialized has to be TRUE before creating any browser"..
I try this:
Code: Select all
procedure TMiniBrowserFrm.FormShow(Sender: TObject);
begin
ShowStatusText('Initializing browser. Please wait...');
// WebRTC's IP leaking can lowered/avoided by setting these preferences
// To test this go to https://www.browserleaks.com/webrtc
Chromium1.WebRTCIPHandlingPolicy := hpDisableNonProxiedUDP;
Chromium1.WebRTCMultipleRoutes := STATE_DISABLED;
Chromium1.WebRTCNonproxiedUDP := STATE_DISABLED;
// GlobalCEFApp.GlobalContext Initialized has to be TRUE before creating any browser
// If it's not initialized yet, we use a simple timer to create the browser later.
if not(Chromium1.CreateBrowser(CEFWindowParent1, '')) then Timer1.Enabled := True;
GlobalCEFApp.cookies := 'C:\bin\blob_storage\';
end;
The directory "blob_storage" is created on debub MiniBrowser demo.. And I could use this directory to store cookies
Does this error occur because the directory permission is incorrect? or the code error?
Re: Simple Cookie DCEF4
Posted: Thu Oct 04, 2018 2:30 pm
by salvadordf
The code you posted belongs to a file with a PAS extension. To edit the DPR in your application, run Delphi and click on the "
Project -> View Source" menu option.
You need to set GlobalCEFApp.cache before the GlobalCEFApp.StartMainProcess call as you can see here :
https://github.com/salvadordf/CEF4Delph ... owser2.dpr
That example shows a GlobalCEFApp.cookies property that is used when you need a
different directory for cache and cookies but you need to set GlobalCEFApp.cache too.
Re: Simple Cookie DCEF4
Posted: Fri Oct 05, 2018 6:53 pm
by danicarla2
Thanks, this worked
