Page 1 of 1

Incognito mode and cookies

Posted: Mon Apr 19, 2021 9:34 am
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;

Re: Incognito mode and cookies

Posted: Mon Apr 19, 2021 9:54 am
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.

Re: Incognito mode and cookies

Posted: Mon Apr 19, 2021 1:42 pm
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

Re: Incognito mode and cookies

Posted: Mon Apr 19, 2021 1:56 pm
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.

Re: Incognito mode and cookies

Posted: Mon Apr 19, 2021 2:32 pm
by dilfich
Yes, it works now, sort of like it was.
Thanks!