Hi,
Use the CookieVisitor demo and modify the CookieVisitorProc procedure to save your cookie.
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.
Simple Cookie DCEF4
- salvadordf
- Posts: 4564
- Joined: Thu Feb 02, 2017 12:24 pm
- Location: Spain
- Contact:
- danicarla2
- Posts: 19
- Joined: Mon Oct 01, 2018 6:01 pm
- Location: Brazil
Re: Simple Cookie DCEF4
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
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
- salvadordf
- Posts: 4564
- Joined: Thu Feb 02, 2017 12:24 pm
- Location: Spain
- Contact:
Re: Simple Cookie DCEF4
Set the GlobalCEFApp.cache property with a writable directory before the GlobalCEFApp.StartMainProcess call in the DPR file.
- danicarla2
- Posts: 19
- Joined: Mon Oct 01, 2018 6:01 pm
- Location: Brazil
Re: Simple Cookie DCEF4
In DPR file says "GlobalCEFApp.GlobalContext Initialized has to be TRUE before creating any browser"..
I try this:
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?
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;
Does this error occur because the directory permission is incorrect? or the code error?
- salvadordf
- Posts: 4564
- Joined: Thu Feb 02, 2017 12:24 pm
- Location: Spain
- Contact:
Re: Simple Cookie DCEF4
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.
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.
- danicarla2
- Posts: 19
- Joined: Mon Oct 01, 2018 6:01 pm
- Location: Brazil
Re: Simple Cookie DCEF4
Thanks, this worked 
