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.
If you find these projects useful please consider becoming a sponsor with Patreon, GitHub or Liberapay.

TChromium.CanSaveCookie event bug

Post Reply
michal@dorfin.waw.pl
Posts: 41
Joined: Sun Feb 05, 2017 8:53 am

TChromium.CanSaveCookie event bug

Post 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.
You do not have the required permissions to view the files attached to this post.
User avatar
salvadordf
Posts: 4575
Joined: Thu Feb 02, 2017 12:24 pm
Location: Spain
Contact:

Re: TChromium.CanSaveCookie event bug

Post 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
Post Reply