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.

How to delete cookies folder

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

How to delete cookies folder

Post by thefunkyjoint »

I've noticed that , even if i destroy TChromium objects, the cookies folder remains locked and i can't delete it with my application ; the only workaround is to close the application and delete the cookies folder using Windows Explorer.

Any way to delete the cookies without needing to close my app ? :roll:
User avatar
salvadordf
Posts: 4304
Joined: Thu Feb 02, 2017 12:24 pm
Location: Spain
Contact:

Re: How to delete cookies folder

Post by salvadordf »

Try using TChromiumCore.DeleteCookies or TChromiumCore.ClearDataForOrigin with cdstCookies as the aStorageTypes parameter.
thefunkyjoint
Posts: 481
Joined: Thu Aug 10, 2017 12:40 pm

Re: How to delete cookies folder

Post by thefunkyjoint »

Thanks, will try... but what i'm trying to understand is, why even after if destroy all TChromium objetcts, the cookies folder is still locked until i close my application . Looks like i still need to do something else in order to 'unlock' the cookies folder :?
thefunkyjoint
Posts: 481
Joined: Thu Aug 10, 2017 12:40 pm

Re: How to delete cookies folder

Post by thefunkyjoint »

I figured out something. Even if i destroy all TChromium objects, there is still 3 or 4 EXE subprocesses of CEF, active on Task manager, so that's probably the culprits to lock the cookies folder.

Is there a way to 'free' everything related to CEF4Delphi on my app, without closing the app ?

What i'm trying to achieve here is, a way to delete ALL cookies folder , but inside my app, without having to close it.
User avatar
salvadordf
Posts: 4304
Joined: Thu Feb 02, 2017 12:24 pm
Location: Spain
Contact:

Re: How to delete cookies folder

Post by salvadordf »

Chromium locks the cookie files internally.

Instead of deleting the cookies when you try to close the application try setting the GlobalCEFApp.DeleteCookies property to True before the GlobalCEFApp.StarMainProcess call in the DPR.

That property will delete the cookies before Chromium locks the files.

In any case, using the CEF API with TChromiumCore.DeleteCookies or TChromiumCore.ClearDataForOrigin is the preferred method.
thefunkyjoint
Posts: 481
Joined: Thu Aug 10, 2017 12:40 pm

Re: How to delete cookies folder

Post by thefunkyjoint »

Ok, thanks for the info !
Post Reply