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.

Cookies on the new version

Post Reply
thefunkyjoint
Posts: 458
Joined: Thu Aug 10, 2017 12:40 pm

Cookies on the new version

Post by thefunkyjoint »

Hello,

It seems there was some change on the cookies management on the latest version ; TCefRequestContextRef.New has new parameters.

But even if i use this :

TCefRequestContextRef.New(cookiesdir, '', '', True, False, False, False);

The cookies are not being loaded ; i was logged in a site and now after update, i'm not logged anymore, even using the correct cookiesdir.

What should i do ?

Thanks
thefunkyjoint
Posts: 458
Joined: Thu Aug 10, 2017 12:40 pm

Re: Cookies on the new version

Post by thefunkyjoint »

I've made some tests and it seems like i need this :

TCefRequestContextRef.New(cookiesdir, '', '', False, False, False, False);

The first boolean parameter should be False, is that right ?

Thanks
User avatar
salvadordf
Posts: 4016
Joined: Thu Feb 02, 2017 12:24 pm
Location: Spain
Contact:

Re: Cookies on the new version

Post by salvadordf »

:oops: :oops: :oops: :oops: :oops:
I think you're right about that parameter.

Please, test it with a FALSE value and I'll update the repository as soon as I can.
thefunkyjoint
Posts: 458
Joined: Thu Aug 10, 2017 12:40 pm

Re: Cookies on the new version

Post by thefunkyjoint »

Yes, with FALSE the looks like the cookies are being loaded correctly. I'll test more and report here the results.
thefunkyjoint
Posts: 458
Joined: Thu Aug 10, 2017 12:40 pm

Re: Cookies on the new version

Post by thefunkyjoint »

Something is strange... i've tested on www.twitter.com. Logged on my account, closed the app. When opening the app again, i'm not logged anymore. Looks like something is missing on the cookies management.
User avatar
salvadordf
Posts: 4016
Joined: Thu Feb 02, 2017 12:24 pm
Location: Spain
Contact:

Re: Cookies on the new version

Post by salvadordf »

I just uploaded your fix. Thanks!!! :D

I did some tests and the twitter session was still open the next time I run the demo.

CEF 90 changed the browser creation sequence and the official cef sample application only creates the browser when the request context is fully initialized.

I need to test this more...
User avatar
salvadordf
Posts: 4016
Joined: Thu Feb 02, 2017 12:24 pm
Location: Spain
Contact:

Re: Cookies on the new version

Post by salvadordf »

I've been testing the cookies with the MDIBrowser and MDIExternalPumpBrowser demos. I modified them to use a fixed cache directory when you select the Create a new request context for new browsers box.

They worked perfectly and the Twitter sessions were still open when I run them several times.

I even opened the Cookies file inside the cache directory with "SQLite Expert Personal" and the twitter cookies were saved correctly.

Please, check the values in the GlobalCEFApp.RootCache and GlobalCEFApp.Cache properties.

GlobalCEFApp.RootCache must be the parent directory of GlobalCEFApp.Cache and all other cache directories used by browsers with custom request contexts.

Also check that the LocalPrefs.json file is inside the GlobalCEFApp.RootCache directory. This file is extremely important because it has a decryption key to read the cookies.

If the application can't find LocalPrefs.json then it will not be able to read the cookies.
thefunkyjoint
Posts: 458
Joined: Thu Aug 10, 2017 12:40 pm

Re: Cookies on the new version

Post by thefunkyjoint »

The first time i tested it did not work, but it seems to be working perfectly now. I'll will monitore and keep you posted. Thank you ! :D
Post Reply