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.

Incognito mode and cookies

Post Reply
dilfich
Posts: 330
Joined: Thu Nov 30, 2017 1:17 am

Incognito mode and cookies

Post by dilfich »

In the 90 version in incognito mode, I can't get cookies, what has changed, what needs to be corrected?

On version 89.0.18 (89.0.4389.114) everything worked.

Code: Select all

procedure TCookieVisitorFrm.FormShow(Sender: TObject);
var
  TempContext : ICefRequestContext;
begin
  // GlobalCEFApp.GlobalContextInitialized 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;

  TempContext := TCefRequestContextRef.New('', '', '', True, False, False, False);
  Chromium1.CreateBrowser(CEFWindowParent1, '', TempContext);
end;
User avatar
salvadordf
Posts: 4016
Joined: Thu Feb 02, 2017 12:24 pm
Location: Spain
Contact:

Re: Incognito mode and cookies

Post by salvadordf »

CEF 90 has a slightly different initialization sequence for the request contexts.
I'll take a look at this issue as soon as I can.
dilfich
Posts: 330
Joined: Thu Nov 30, 2017 1:17 am

Re: Incognito mode and cookies

Post by dilfich »

The problem is not only that I can't get them, they are simply not in the current session.
And this is quite critical. :(

devtools
the scheme of this connection is not allowed to store cookies
User avatar
salvadordf
Posts: 4016
Joined: Thu Feb 02, 2017 12:24 pm
Location: Spain
Contact:

Re: Incognito mode and cookies

Post by salvadordf »

Please, download CEF4Delphi again or use this to create the request context :

Code: Select all

TempContext := TCefRequestContextRef.New(MyCustomCacheDirectory, '', '', False, False, False, False);
The first boolean parameter must be FALSE to store cookies.
dilfich
Posts: 330
Joined: Thu Nov 30, 2017 1:17 am

Re: Incognito mode and cookies

Post by dilfich »

Yes, it works now, sort of like it was.
Thanks!
Post Reply