Page 1 of 1

TChromium.CanSaveCookie event bug

Posted: Thu Apr 16, 2020 12:15 pm
by michal@dorfin.waw.pl
I found stange bug in TChromium.OnCanSaveCookie event.
Here is my code. This method is connected with TChromium "OnCanSaveCookie"

Code: Select all

procedure TBrowserFrame.CHROMECanSaveCookie(Sender: TObject; const browser: ICefBrowser; const frame: ICefFrame; const request: ICefRequest; const response: ICefResponse; const cookie: PCefCookie; var aResult: Boolean);
begin
 //
 aResult:=TRUE;
end;
As You can see it does nothing. Always returns "aResult := TRUE".
I have one site with login page: https://serwis.axadirect.pl/partner/Login.html
When I sign in with correct credentials the site cant progress as it "reloads" login form endlessly.
Once I remove this event - everything is working fine.
I think that it has something to do with the cookies.
I investigated cookies (it was not easy as the page reloads quicly and cookies change dynamically).
I found out theat this page registers two cookies with the same name. Which is strange. See attaced image. The "_ga" cookie is set twice with different data.
I don't know if it this done "by the book" but maybe this causes the error when the event is set.

Re: TChromium.CanSaveCookie event bug

Posted: Mon Apr 20, 2020 8:52 am
by salvadordf
Hi,

The CEF project has fixed some issues with the cookies recently :
https://bitbucket.org/chromiumembedded/ ... omatically

As you can see in that page, there are still some pending changes but I would try setting the GlobalCEFApp.Cache and GlobalCEFApp.RootCache properties to a valid and writable directory.

GlobalCEFApp.RootCache should be the same or a parent directory of GlobalCEFApp.Cache

I would also try setting to true these properties :
  • GlobalCEFApp.PersistSessionCookies
  • GlobalCEFApp.PersistUserPreferences
  • GlobalCEFApp.DisableSiteIsolationTrials